ForeignValidator extends Validator
Checks if field value exists in referenced entity
example: new Foreign(GroupTable::getEntity()->getField('ID'));
Table of Contents
Constants
- NOT_EXISTS = 'BX_FOREIGN_NOT_EXISTS'
Methods
- __construct() : mixed
- validate() : string|bool|EntityError
Constants
NOT_EXISTS
public
mixed
NOT_EXISTS
= 'BX_FOREIGN_NOT_EXISTS'
Methods
__construct()
public
__construct(Field $reference[, array<string|int, mixed> $filter = array() ]) : mixed
Parameters
- $reference : Field
- $filter : array<string|int, mixed> = array()
validate()
public
validate(mixed $value, mixed $primary, array<string|int, mixed> $row, Field $field) : string|bool|EntityError
Parameters
- $value : mixed
- $primary : mixed
- $row : array<string|int, mixed>
- $field : Field