Rule implements JsonSerializable
AbstractYes
Table of Contents
Interfaces
- JsonSerializable
Methods
- __construct() : mixed
- Rule constructor.
- assignValue() : bool
- Assigns the value if it follows the rule.
- compare() : bool
- Checks if the value follows the rule.
- getGroupId() : int
- getOptions() : array<string|int, mixed>
- getTitle() : string
- getValue() : mixed
- jsonSerialize() : array<string|int, mixed>
- JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
- setGroupId() : Rule
Methods
__construct()
Rule constructor.
public
__construct(string $title[, mixed $value = 0 ][, array<string|int, mixed>|null $options = null ]) : mixed
Parameters
- $title : string
- $value : mixed = 0
- $options : array<string|int, mixed>|null = null
assignValue()
Assigns the value if it follows the rule.
public
assignValue(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolcompare()
Checks if the value follows the rule.
public
abstract compare(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolgetGroupId()
public
getGroupId() : int
Return values
intgetOptions()
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getTitle()
public
getTitle() : string
Return values
stringgetValue()
public
getValue() : mixed
jsonSerialize()
JsonSerializable::jsonSerialize — Specify data which should be serialized to JSON
public
jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>setGroupId()
public
setGroupId(int $groupId) : Rule
Parameters
- $groupId : int