$structure
$structure : array
Provides basic implementation of an object that are eligible for CRUD operations inside a database.
$database : \Gishiki\Database\DatabaseInterface
__construct(\Gishiki\Database\DatabaseInterface $connection)
Create a new object.
\Gishiki\Database\DatabaseInterface | $connection | the database connection to be used |
load(\Gishiki\Database\DatabaseInterface $connection) : array<mixed,\Gishiki\Core\MVC\Model\ActiveRecordInterface>
Read one or more object from the database.
\Gishiki\Database\DatabaseInterface | $connection | the database connection to be used |
the result set
getReferenceID() : integer
Return the current object ID.
Exactly as getObjectID(), this function also ensure an ID is returned, and if it is not a save() operation will be performed, in order to generate that ID.
the current object ID, as it is used within the database
initSchema(\Gishiki\Database\DatabaseInterface $connection)
\Gishiki\Database\DatabaseInterface | $connection |
loadFields(\Gishiki\Database\Schema\Table $table)
Load all fields inside the table from the static::$structure array.
\Gishiki\Database\Schema\Table | $table | the table structure to be finalized with fields |
the exception preventing data to be parsed correctly
loadField(\Gishiki\Database\Schema\Table $table, array $fieldDefinition, string $fieldName = null)
Load a field inside the table from the static::$structure array.
\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 |
the exception preventing data to be parsed correctly
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.
\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 |
the exception preventing relation to be created