Метод |
Описание |
|
__isset ( $key ) : mixed |
Because we are changing the case of keys and want to use camelCase throughout the application, whenever
we do isset checks we need to ensure that we check using snake_case. |
|
__unset ( $key ) : void |
Because we are changing the case of keys and want to use camelCase throughout the application, whenever
we do unset variables we need to ensure that we unset using snake_case. |
|
attributesToArray ( ) : array |
Return the attributes for the model, converting field casing if necessary. |
|
getAttribute ( string $key ) : mixed |
Retrieve a given attribute but allow it to be accessed via alternative case methods (such as camelCase). |
|
getAttributes ( $keys = [] ) : array |
Converts the attributes to a camel-case version, if applicable. |
|
getDates ( ) : array |
Overloads the eloquent getDates method to ensure that date field declarations
can be made in camelCase but mapped to/from DB in snake_case. |
|
getHidden ( ) : array |
Overloads eloquent's getHidden method to ensure that hidden fields declared
in camelCase are actually hidden and not exposed when models are turned
into arrays. |
|
getOriginal ( string $key = null, mixed $default = null ) : array |
Get the model's original attribute values. |
|
getTrueKey ( $key ) : string |
Retrieves the true key name for a key. |
|
isCamelCase ( ) : boolean |
Determines whether the model (or its parent) requires camelcasing. This is required
for pivot models whereby they actually depend on their parents for this feature. |
|
relationsToArray ( ) : array |
Get the model's relationships, converting field casing if necessary. |
|
setAttribute ( string $key, mixed $value ) |
Overloads the eloquent setAttribute method to ensure that fields accessed
in any case are converted to snake_case, which is the defacto standard
for field names in databases. |
|
toCamelCase ( mixed $attributes ) : array |
Converts a given array of attribute keys to the casing required by CamelCaseModel. |
|
toSnakeCase ( $attributes ) : array |
Converts a given array of attribute keys to the casing required by CamelCaseModel. |
|