\Gishiki\Core\MVC\ModelActiveRecordStructureTrait

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
getTableDefinition()
initSchema()
loadTable()
loadFields()
loadField()
loadRelation()
$typeMap
N/A

Properties

$typeMap

$typeMap : 

Type

Methods

getTableDefinition()

getTableDefinition() 

loadTable()

loadTable() 

Load the table definition from the static::$structure array.

Throws

\Gishiki\Core\MVC\Model\ActiveRecordException

the exception preventing data to be parsed correctly

loadFields()

loadFields(\Gishiki\Database\Schema\Table  $table) 

Load all fields inside the table from the static::$structure array.

Parameters

\Gishiki\Database\Schema\Table $table

the table structure to be finalized with fields

Throws

\Gishiki\Core\MVC\Model\ActiveRecordException

the exception preventing data to be parsed correctly

loadField()

loadField(\Gishiki\Database\Schema\Table  $table, array  $fieldDefinition, string  $fieldName = null) 

Load a field inside the table from the static::$structure array.

Parameters

\Gishiki\Database\Schema\Table $table

the table structure to be finalized with fields

array $fieldDefinition

the field definition

string $fieldName

the short name for the column

Throws

\Gishiki\Core\MVC\Model\ActiveRecordException

the exception preventing data to be parsed correctly

loadRelation()

loadRelation(\Gishiki\Database\Schema\Column  $column, string  $className, string  $propName) 

Load a relation to another class.

If the given class is not registered attempt to register it by loading its table structure definition.

Parameters

\Gishiki\Database\Schema\Column $column

the column to be updated with the given relation

string $className

the name of the ActiveRecord class

string $propName

the name of the property to be used

Throws

\Gishiki\Core\MVC\Model\ActiveRecordException

the exception preventing relation to be created