<?php
namespace App\Model\Query\ConditionQuery\Type;
use App\Model\Query\ConditionQuery\AbstractType;
use App\Model\Query\ConditionQuery\Condition\EqualCondition;
use App\Model\Query\ConditionQuery\Condition\GreaterThanCondition;
use App\Model\Query\ConditionQuery\Condition\GreaterThanEqualCondition;
use App\Model\Query\ConditionQuery\Condition\LessThanCondition;
use App\Model\Query\ConditionQuery\Condition\LessThanEqualCondition;
use App\Model\Query\ConditionQuery\Condition\NotEqualCondition;
/**
*
*/
final class IntegerType extends AbstractType
{
const NAME = 'int';
/**
* {@inheritDoc}
*/
public function validate($value): void
{
// TODO
}
/**
* @return string[]
*/
public function getValidOperators(): array
{
if ($this->allowsMultiple()) {
return self::VALID_ARRAY_OPERATOR_NAMES;
}
return [
EqualCondition::NAME => EqualCondition::HUMAN_READABLE_NAME,
GreaterThanCondition::NAME => GreaterThanCondition::HUMAN_READABLE_NAME,
GreaterThanEqualCondition::NAME => GreaterThanEqualCondition::HUMAN_READABLE_NAME,
LessThanCondition::NAME => LessThanCondition::HUMAN_READABLE_NAME,
LessThanEqualCondition::NAME => LessThanEqualCondition::HUMAN_READABLE_NAME,
NotEqualCondition::NAME => NotEqualCondition::HUMAN_READABLE_NAME,
];
}
}