$constraints =
[ 'operator' =>
[ new NotBlank(),
new Choice([self::OPERATOR_EQ, self::OPERATOR_NEQ, self::OPERATOR_EMPTY
]),
],
];
if ($this->operator === self::OPERATOR_EMPTY
) { return $constraints;
} $constraints['stateIds'
] =
[new NotBlank(),
new ArrayOfUuid()];
return $constraints;
} public function getConfig(): RuleConfig
{ return (new RuleConfig()) ->
operatorSet(RuleConfig::OPERATOR_SET_STRING, true, true
) ->
entitySelectField('stateIds', CountryStateDefinition::ENTITY_NAME, true
);
}}