/var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/ORM/Rule
Edit: /var/www/vhosts/ihelp.ro/_OLD/vendor/cakephp/cakephp/src/ORM/Rule/ValidCount.php (1685B)
_field = $field;
}
/**
* Performs the count check
*
* @param \Cake\Datasource\EntityInterface $entity The entity from where to extract the fields.
* @param array $options Options passed to the check.
* @return bool True if successful, else false.
*/
public function __invoke(EntityInterface $entity, array $options): bool
{
$value = $entity->{$this->_field};
if (!is_array($value) && !$value instanceof Countable) {
return false;
}
return Validation::comparison(count($value), $options['operator'], $options['count']);
}
}