MetaFox

UniqueValueInArray
in package
implements Rule

Table of Contents

Interfaces

Rule

Properties

$fields  : array<string|int, string>

Methods

__construct()  : mixed
UniqueValueInArray constructor.
message()  : string
passes()  : bool
Will validate the uniqueness against field's value when it's formatted as the following example: <code> [ ['field' => 'value 1', ...], ['field' => 'value 2', ...], ] </code> The 'field' must be included when initiating the Rule.

Properties

Methods

__construct()

UniqueValueInArray constructor.

public __construct(array<string|int, string> $uniqueFields) : mixed
Parameters
$uniqueFields : array<string|int, string>

passes()

Will validate the uniqueness against field's value when it's formatted as the following example: <code> [ ['field' => 'value 1', ...], ['field' => 'value 2', ...], ] </code> The 'field' must be included when initiating the Rule.

public passes(string $attribute, mixed $value) : bool
Parameters
$attribute : string
$value : mixed
Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
bool

        
On this page

Search results