PHP Класс Eloquent\Phony\Verification\Cardinality

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( integer $minimum = 1, integer | null $maximum = null, boolean $isAlways = false ) Construct a new cardinality.
assertSingular ( ) Asserts that this cardinality is suitable for events that can only happen once or not at all.
isAlways ( ) : boolean Returns true if 'always' is enabled.
isNever ( ) : boolean Returns true if this cardinality is 'never'.
matches ( integer | boolean $count, integer $maximumCount ) : boolean Returns true if the supplied count matches this cardinality.
maximum ( ) : integer | null Get the maximum.
minimum ( ) : integer Get the minimum.
setIsAlways ( boolean $isAlways ) Turn 'always' on or off.

Описание методов

__construct() публичный Метод

Construct a new cardinality.
public __construct ( integer $minimum = 1, integer | null $maximum = null, boolean $isAlways = false )
$minimum integer The minimum.
$maximum integer | null The maximum, or null for no maximum.
$isAlways boolean True if 'always' should be enabled.

assertSingular() публичный Метод

Asserts that this cardinality is suitable for events that can only happen once or not at all.
public assertSingular ( )

isAlways() публичный Метод

Returns true if 'always' is enabled.
public isAlways ( ) : boolean
Результат boolean True if 'always' is enabled.

isNever() публичный Метод

Returns true if this cardinality is 'never'.
public isNever ( ) : boolean
Результат boolean True if this cardinality is 'never'.

matches() публичный Метод

Returns true if the supplied count matches this cardinality.
public matches ( integer | boolean $count, integer $maximumCount ) : boolean
$count integer | boolean The count or result to check.
$maximumCount integer The maximum possible count.
Результат boolean True if the supplied count matches this cardinality.

maximum() публичный Метод

Get the maximum.
public maximum ( ) : integer | null
Результат integer | null The maximum.

minimum() публичный Метод

Get the minimum.
public minimum ( ) : integer
Результат integer The minimum.

setIsAlways() публичный Метод

Turn 'always' on or off.
public setIsAlways ( boolean $isAlways )
$isAlways boolean True to enable 'always'.