BackendInterface

Storage backend interface

Table of Contents

Methods

addRow()  : int
Adds a row to the storage
getObjectCountByQuery()  : int
Returns the number of items matching the query.
getObjectDataByQuery()  : array<string|int, mixed>
Returns the object data matching the $query.
getUidOfAlreadyPersistedValueObject()  : int|null
Checks if a Value Object equal to the given Object exists in the data base
removeRow()  : void
Deletes a row in the storage
updateRelationTableRow()  : void
Updates a relation row in the storage
updateRow()  : void
Updates a row in the storage

Methods

addRow()

Adds a row to the storage

public addRow(string $tableName, array<string|int, mixed> $fieldValues[, bool $isRelation = false ]) : int
Parameters
$tableName : string

The database table name

$fieldValues : array<string|int, mixed>

The fieldValues to insert

$isRelation : bool = false

TRUE if we are currently inserting into a relation table, FALSE by default

Return values
int

the UID of the inserted row

getObjectCountByQuery()

Returns the number of items matching the query.

public getObjectCountByQuery(QueryInterface $query) : int
Parameters
$query : QueryInterface
Return values
int

getObjectDataByQuery()

Returns the object data matching the $query.

public getObjectDataByQuery(QueryInterface $query) : array<string|int, mixed>
Parameters
$query : QueryInterface
Return values
array<string|int, mixed>

getUidOfAlreadyPersistedValueObject()

Checks if a Value Object equal to the given Object exists in the data base

public getUidOfAlreadyPersistedValueObject(AbstractValueObject $object) : int|null
Parameters
$object : AbstractValueObject

The Value Object

Tags
todo

this is the last monster in this persistence series. refactor!

Return values
int|null

The matching uid if an object was found, else null

removeRow()

Deletes a row in the storage

public removeRow(string $tableName, array<string|int, mixed> $where[, bool $isRelation = false ]) : void
Parameters
$tableName : string

The database table name

$where : array<string|int, mixed>

An array of where array('fieldname' => value). This array will be transformed to a WHERE clause

$isRelation : bool = false

TRUE if we are currently inserting into a relation table, FALSE by default

updateRelationTableRow()

Updates a relation row in the storage

public updateRelationTableRow(string $tableName, array<string|int, mixed> $fieldValues) : void
Parameters
$tableName : string

The database relation table name

$fieldValues : array<string|int, mixed>

The fieldValues to be updated

updateRow()

Updates a row in the storage

public updateRow(string $tableName, array<string|int, mixed> $fieldValues[, bool $isRelation = false ]) : void
Parameters
$tableName : string

The database table name

$fieldValues : array<string|int, mixed>

The fieldValues to update

$isRelation : bool = false

TRUE if we are currently inserting into a relation table, FALSE by default


        
On this page

Search results