__('Hide Doctor', 'care-book-ultimate'), self::HIDE_SERVICE => __('Hide Service', 'care-book-ultimate'), self::HIDE_COMBINATION => __('Hide Doctor/Service Combination', 'care-book-ultimate'), }; } /** * Get description for restriction type * * @return string * @since 1.0.0 */ public function getDescription(): string { return match ($this) { self::HIDE_DOCTOR => __('Hide doctor from all appointment forms', 'care-book-ultimate'), self::HIDE_SERVICE => __('Hide service from all appointment forms', 'care-book-ultimate'), self::HIDE_COMBINATION => __('Hide specific doctor/service combination only', 'care-book-ultimate'), }; } /** * Get CSS selector pattern for restriction type * * @return string * @since 1.0.0 */ public function getCssPattern(): string { return match ($this) { self::HIDE_DOCTOR => '[data-doctor-id="{doctor_id}"]', self::HIDE_SERVICE => '[data-service-id="{service_id}"]', self::HIDE_COMBINATION => '[data-doctor-id="{doctor_id}"][data-service-id="{service_id}"]', }; } /** * Check if restriction type requires service ID * * @return bool * @since 1.0.0 */ public function requiresServiceId(): bool { return match ($this) { self::HIDE_DOCTOR => false, self::HIDE_SERVICE => true, self::HIDE_COMBINATION => true, }; } /** * Get all available restriction types * * @return array * @since 1.0.0 */ public static function getOptions(): array { $options = []; foreach (self::cases() as $case) { $options[$case->value] = $case->getLabel(); } return $options; } /** * Create from string value with validation * * @param string $value * @return self * @throws \InvalidArgumentException * @since 1.0.0 */ public static function fromString(string $value): self { return self::tryFrom($value) ?? throw new \InvalidArgumentException( "Invalid restriction type: {$value}" ); } }