src/App/Model/Query/ConditionQuery/Type/RoleTypeType.php

Open in your IDE?
  1. <?php
  2. namespace App\Model\Query\ConditionQuery\Type;
  3. use App\Model\Query\ConditionQuery\AbstractType;
  4. use App\Model\Query\ConditionQuery\Condition\EqualCondition;
  5. use App\Model\Query\ConditionQuery\Condition\NotEqualCondition;
  6. final class RoleTypeType extends AbstractType
  7. {
  8.     const NAME 'role_type';
  9.     /**
  10.      * {@inheritDoc}
  11.      */
  12.     public function validate($value): void
  13.     {
  14.         // TODO
  15.     }
  16.     /**
  17.      * @return string[]
  18.      */
  19.     public function getValidOperators(): array
  20.     {
  21.         if ($this->allowsMultiple()) {
  22.             return self::VALID_ARRAY_OPERATOR_NAMES;
  23.         }
  24.         return [
  25.             EqualCondition::NAME => EqualCondition::HUMAN_READABLE_NAME,
  26.             NotEqualCondition::NAME => NotEqualCondition::HUMAN_READABLE_NAME,
  27.         ];
  28.     }
  29.     /**
  30.      * {@inheritDoc}
  31.      */
  32.     public function getEnum(): ?string
  33.     {
  34.         return '_role_type';
  35.     }
  36. }