ValidCount
in package
Validates the count of associated records.
Table of Contents
Properties
- $_field : string
- The field to check
Methods
- __construct() : mixed
- Constructor.
- __invoke() : bool
- Performs the count check
Properties
$_field
The field to check
protected
string
$_field
Methods
__construct()
Constructor.
public
__construct(string $field) : mixed
Parameters
- $field : string
-
The field to check the count on.
__invoke()
Performs the count check
public
__invoke(EntityInterface $entity, array<string, mixed> $options) : bool
Parameters
- $entity : EntityInterface
-
The entity from where to extract the fields.
- $options : array<string, mixed>
-
Options passed to the check.
Return values
bool —True if successful, else false.