Метод | Описание | |
---|---|---|
clear ( ) | Remove all attributes. | |
count ( ) : integer | Return the number of set options. | |
hasDefault ( $attribute ) : boolean | Return whether a default value is set for an attribute. | |
remove ( $attributes ) : |
Removes the attributes with the given name. | |
resolve ( array $attributes ) : array | Merges options with the default values and validates them. | |
setDefault ( string $attribute, mixed $value, string $type = null, boolean $required = false, boolean $nullable = false ) : |
Sets the default value of a given attribute. | |
setValidator ( string $attribute, Closure $validator ) : |
Sets the validator for an atribute. |
public hasDefault ( $attribute ) : boolean | ||
Результат | boolean |
public remove ( $attributes ) : |
||
Результат | This instance |
public setDefault ( string $attribute, mixed $value, string $type = null, boolean $required = false, boolean $nullable = false ) : |
||
$attribute | string | The name of the attribute |
$value | mixed | The default value of the attribute |
$type | string | The accepted type. Any type for which a corresponding is_ |
$required | boolean | Is that attribute required? |
$nullable | boolean | Is that attribute nullable? |
Результат | This instance |
public setValidator ( string $attribute, Closure $validator ) : |
||
$attribute | string | The name of the attribute |
$validator | Closure | The validator should be a closure with the following signature: ```php function ($value) { // ... } ``` |
Результат | This instance |