Свойство | Тип | Описание | |
---|---|---|---|
$data | |||
$db | |||
$logger |
Метод | Описание | |
---|---|---|
__construct ( PDO $db, integer $id = null ) | ||
delete ( ) | Delete object from the database. Deleted object retains its data except for the primary key value. | |
get ( string $name ) : mixed | Get object property. | |
getData ( ) : array | Get object data in an associative array. | |
getDatabaseHandle ( ) : PDO | Get database handle used to instantiate the object. | |
getRequiredProperties ( ) : array | Properties that are not nullable and do not have a default value. | |
getSynchronisationCount ( ) : integer | Synchronisation count is used for unit testing only. | |
offsetExists ( mixed $offset ) : boolean | ||
offsetGet ( mixed $offset ) : mixed | ||
offsetSet ( mixed $offset, $value ) : void | ||
offsetUnset ( mixed $offset ) : void | ||
populate ( array $data ) : Gajus\MOA\Mother | Shorthand method to pass each array key, value pair to the setter. | |
save ( ) | Save the object to the database. Depending on whether object's primary key is set this method will either attempt to insert the object to the database or update an existing entry. | |
set ( string $name, mixed $value = null ) : boolean | Set object property. | |
setLogger ( Psr\Log\LoggerInterface $logger ) : null | Sets a logger instance on the object |
Метод | Описание | |
---|---|---|
afterDelete ( ) : void | Triggered after DELETE query but before the transaction is committed. | |
afterInsert ( ) : void | Triggered after INSERT query but before the transaction is committed. | |
afterUpdate ( ) : void | Triggered after UPDATE query but before the transaction is committed. | |
validateSave ( ) : null | mixed | Triggered when an attempt is made to save object state. | |
validateSet ( string $name, mixed $value ) : null | string | Triggered when an attempt is made to change object property. |
Метод | Описание | |
---|---|---|
synchronise ( ) : void | Use the primary key to update object instance with the data from the database. |
public __construct ( PDO $db, integer $id = null ) | ||
$db | PDO | |
$id | integer |
protected afterDelete ( ) : void | ||
Результат | void |
protected afterInsert ( ) : void | ||
Результат | void |
protected afterUpdate ( ) : void | ||
Результат | void |
public delete ( ) |
public getDatabaseHandle ( ) : PDO | ||
Результат | PDO |
public getRequiredProperties ( ) : array | ||
Результат | array |
public getSynchronisationCount ( ) : integer | ||
Результат | integer |
public offsetExists ( mixed $offset ) : boolean | ||
$offset | mixed | |
Результат | boolean |
public offsetUnset ( mixed $offset ) : void | ||
$offset | mixed | |
Результат | void |
public save ( ) |
protected validateSave ( ) : null | mixed | ||
Результат | null | mixed |