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