Свойство | Type | Description | |
---|---|---|---|
$juggling | boolean | Whether the model is type juggling attributes or not. |
Méthode | Description | |
---|---|---|
__get ( string $key ) : mixed | Dynamically retrieve attributes on the model. | |
__set ( string $key, mixed $value ) | Dynamically set attributes on the model. | |
addJugglable ( string $attribute, string $type ) | Add an attribute to the jugglable array. | |
attributesToArray ( ) : array | Override attributesToArray() Eloquent Model method, to type juggle first, and then call the parent method. | |
buildJuggleMethod ( string $type ) : string | Build the method name that the type normalizes to. | |
checkJuggleType ( string $type ) : boolean | Checks whether the type is a type that can be juggled to. | |
getJugglable ( ) : array | Get the juggable attributes. | |
getJuggleType ( string $attribute ) : string | Gets the type that the attribute will be casted to. | |
getJuggling ( ) : boolean | Returns whether or not the model will juggle attributes. | |
isJugglable ( string $attribute ) : boolean | Returns whether the attribute is type jugglable. | |
isJuggleType ( string $type ) : boolean | Returns whether the type is a type that can be juggled to. | |
juggle ( mixed $value, string $type ) : mixed | Cast the value to the attribute's type as specified in the juggable array. | |
juggleArray ( mixed $value ) : array | Returns the value as an array. | |
juggleAttribute ( string $attribute, string $value ) | Casts a value to the coresponding attribute type and sets it on the attributes array of this model. | |
juggleAttributes ( ) | Juggles all attributes that are configured to be juggled. | |
juggleBoolean ( mixed $value ) : boolean | Returns the value as a boolean. | |
juggleDate ( mixed $value ) : Carbon\Carbon\Carbon | Returns the value as a Carbon instance. | |
juggleDateTime ( mixed $value ) : string | Returns a string formated as ISO standard of 0000-00-00 00:00:00. | |
juggleFloat ( mixed $value ) : float | Returns the value as a float. | |
juggleInteger ( mixed $value ) : integer | Returns the value as an integer. | |
juggleNull ( mixed $value ) : mixed | null | Casts to null on empty. | |
juggleString ( mixed $value ) : string | Returns the value as a string. | |
juggleTimestamp ( mixed $value ) : integer | Returns the date as a Unix timestamp. | |
mergeJugglable ( array $attributes ) | Merge an array of attributes with the jugglable array. | |
removeJugglable ( mixed $attributes ) | Remove an attribute or several attributes from the jugglable array. | |
setJugglable ( array $attributes ) | Set the jugglable attributes. | |
setJuggling ( $value ) | Set whether or not the model will juggle attributes. |
Méthode | Description | |
---|---|---|
getDynamicJuggle ( string $key, mixed $value ) : mixed | If juggling is active, it returns the juggleAttribute. | |
juggleType ( mixed $value, string $type ) : mixed | Casts the value to the type. Possibles types are: boolean, integer, float, string, array, object, null. | |
setDynamicJuggle ( string $key, mixed $value ) | If juggling is active, it sets the attribute in the model by type juggling the value first. |
public addJugglable ( string $attribute, string $type ) | ||
$attribute | string | |
$type | string |
public attributesToArray ( ) : array | ||
Résultat | array |
public buildJuggleMethod ( string $type ) : string | ||
$type | string | to cast |
Résultat | string |
public checkJuggleType ( string $type ) : boolean | ||
$type | string | to cast |
Résultat | boolean |
public getJugglable ( ) : array | ||
Résultat | array |
public getJuggleType ( string $attribute ) : string | ||
$attribute | string | |
Résultat | string |
public getJuggling ( ) : boolean | ||
Résultat | boolean |
public isJugglable ( string $attribute ) : boolean | ||
$attribute | string | name |
Résultat | boolean |
public isJuggleType ( string $type ) : boolean | ||
$type | string | to cast |
Résultat | boolean |
public juggleArray ( mixed $value ) : array | ||
$value | mixed | |
Résultat | array |
public juggleAttribute ( string $attribute, string $value ) | ||
$attribute | string | |
$value | string |
public juggleAttributes ( ) |
public juggleBoolean ( mixed $value ) : boolean | ||
$value | mixed | |
Résultat | boolean |
public juggleDate ( mixed $value ) : Carbon\Carbon\Carbon | ||
$value | mixed | |
Résultat | Carbon\Carbon\Carbon |
public juggleDateTime ( mixed $value ) : string | ||
$value | mixed | |
Résultat | string |
public juggleFloat ( mixed $value ) : float | ||
$value | mixed | |
Résultat | float |
public juggleInteger ( mixed $value ) : integer | ||
$value | mixed | |
Résultat | integer |
public juggleString ( mixed $value ) : string | ||
$value | mixed | |
Résultat | string |
public juggleTimestamp ( mixed $value ) : integer | ||
$value | mixed | |
Résultat | integer |
public mergeJugglable ( array $attributes ) | ||
$attributes | array | to juggle |
public removeJugglable ( mixed $attributes ) | ||
$attributes | mixed |
protected setDynamicJuggle ( string $key, mixed $value ) | ||
$key | string | |
$value | mixed |
public setJugglable ( array $attributes ) | ||
$attributes | array | to juggle |
public setJuggling ( $value ) |
protected bool $juggling | ||
Résultat | boolean |