src/App/Model/Query/ConditionQuery/Type/StringType.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\InCondition;
  6. use App\Model\Query\ConditionQuery\Condition\NotEqualCondition;
  7. use App\Model\Query\ConditionQuery\Condition\NotInCondition;
  8. /**
  9.  *
  10.  */
  11. final class StringType extends AbstractType
  12. {
  13.     const NAME 'string';
  14.     /**
  15.      * {@inheritDoc}
  16.      */
  17.     public function validate($value): void
  18.     {
  19.         // TODO
  20.     }
  21.     /**
  22.      * @return string[]
  23.      */
  24.     public function getValidOperators(): array
  25.     {
  26.         if ($this->allowsMultiple()) {
  27.             return self::VALID_ARRAY_OPERATOR_NAMES;
  28.         }
  29.         return [
  30.             EqualCondition::NAME => EqualCondition::HUMAN_READABLE_NAME,
  31.             NotEqualCondition::NAME => NotEqualCondition::HUMAN_READABLE_NAME,
  32.         ];
  33.     }
  34. }