\Gishiki\Core\MVC\ModelActiveRecordSerializationTrait

Provides a working implementation of table schema extractor.

Summary

Methods
Properties
Constants
No public methods found
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
getPrimaryKeyName()
getCollectionName()
initTransitionSchema()
executeFilters()
executeFilter()
$transformations
$filters
$collection
$primaryKey
N/A

Properties

$transformations

$transformations : array

Type

array — the matrix of transformation of model_entry_key => db_row_name

$filters

$filters : array<mixed,\Closure>

Type

array<mixed,\Closure> — the collection of function to be executed to cast each model_entry_key in a correct value

$collection

$collection : string

Type

string — the name of the table/collection that will hold current model data

$primaryKey

$primaryKey : string

Type

string — the name (model wise) of the primary key (if any)

Methods

getPrimaryKeyName()

getPrimaryKeyName() : string

Get the name of the primary key field.

Returns

string —

the name of the primary key

getCollectionName()

getCollectionName() : string

Get the name of the table or collection that will hold data.

Returns

string —

the collection name

initTransitionSchema()

initTransitionSchema() 

Load filtering functions from static::$structure array.

Throws

\Gishiki\Core\MVC\Model\ActiveRecordException

workflow problem

executeFilters()

executeFilters(array  $data) : array

Apply data filters on the given data.

Parameters

array $data

the data to be filtered

Returns

array —

the filtered data, ready to be written to the database

executeFilter()

executeFilter(string  $key, mixed  $value) : mixed

Perform every necessary filtering value on a given model portion.

Parameters

string $key

the key associated with the given value

mixed $value

the value to be filtered

Returns

mixed —

the filtered value