ZenMagick 0.9.10


org.zenmagick.core.services.database.provider\ZMPdoDatabase
core\services\database\provider\ZMPdoDatabase.php at line 33

Class ZMPdoDatabase

ZMObject
└─ZMPdoDatabase
All Implemented Interfaces:
org.zenmagick.core.services.database\ZMDatabase

public class ZMPdoDatabase
extends ZMObject

Implementation of the ZenMagick database layer using PDO.

Support for nested transactions via SAVEPOINTs inspired by http://www.kennynet.co.uk/2008/12/02/php-pdo-nested-transactions/.

Author:
DerManoMann

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct(array conf)

Create a new instance.

void

beginTransaction()

{@inheritDoc}

void

commit()

{@inheritDoc}

void

createModel(mixed table, mixed model, mixed mapping)

{@inheritDoc}

void

getConfig()

{@inheritDoc}

protected long

getExecutionTime(string start)

Get the elapsed time since $start.

void

getMetaData(mixed table)

{@inheritDoc}

void

getResource()

{@inheritDoc}

void

getStats()

{@inheritDoc}

protected boolean

isNestedTransactions()

Does this instance allow nested transactions?

void

loadModel(mixed table, mixed key, mixed modelClass, mixed mapping)

{@inheritDoc}

protected A

prepareStatement(string sql, mixed args, array mapping)

Create a prepared statement.

void

query(mixed sql, mixed args, mixed modelClass)

{@inheritDoc}

void

querySingle(mixed sql, mixed args, mixed modelClass)

{@inheritDoc}

void

removeModel(mixed table, mixed model, mixed mapping)

{@inheritDoc}

void

rollback()

{@inheritDoc}

protected static array

translateRow(array row, array mapping)

Translate a given raw database row with the given mapping.

void

update(mixed sql, mixed data)

{@inheritDoc}

void

updateModel(mixed table, mixed model, mixed mapping)

{@inheritDoc}

Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Method Detail

core\services\database\provider\ZMPdoDatabase.php at line 50

__construct

public void __construct(array conf)

Create a new instance.

Supports the custom configuration setting persistent (true | false)

.

Parameters:
conf - Configuration properties.

core\services\database\provider\ZMPdoDatabase.php at line 133

beginTransaction

public void beginTransaction()


core\services\database\provider\ZMPdoDatabase.php at line 150

commit

public void commit()


core\services\database\provider\ZMPdoDatabase.php at line 256

createModel

public void createModel(mixed table, mixed model, mixed mapping)


core\services\database\provider\ZMPdoDatabase.php at line 126

getConfig

public void getConfig()


core\services\database\provider\ZMPdoDatabase.php at line 202

getExecutionTime

protected long getExecutionTime(string start)

Get the elapsed time since $start.

Parameters:
start - The starting time.
Returns:
The time in milliseconds.

core\services\database\provider\ZMPdoDatabase.php at line 596

getMetaData

public void getMetaData(mixed table)


core\services\database\provider\ZMPdoDatabase.php at line 641

getResource

public void getResource()


core\services\database\provider\ZMPdoDatabase.php at line 184

getStats

public void getStats()


core\services\database\provider\ZMPdoDatabase.php at line 119

isNestedTransactions

protected boolean isNestedTransactions()

Does this instance allow nested transactions?

Returns:
true if nested transactions are supported.

core\services\database\provider\ZMPdoDatabase.php at line 211

loadModel

public void loadModel(mixed table, mixed key, mixed modelClass, mixed mapping)


core\services\database\provider\ZMPdoDatabase.php at line 478

prepareStatement

protected A prepareStatement(string sql, mixed args, array mapping)

Create a prepared statement.

Parameters:
sql - The initial SQL.
args - The data either as map or ZMObject instance.
mapping - The field mapping.
Returns:
PreparedStatement or null;

core\services\database\provider\ZMPdoDatabase.php at line 442

query

public void query(mixed sql, mixed args, mixed modelClass)


core\services\database\provider\ZMPdoDatabase.php at line 434

querySingle

public void querySingle(mixed sql, mixed args, mixed modelClass)


core\services\database\provider\ZMPdoDatabase.php at line 308

removeModel

public void removeModel(mixed table, mixed model, mixed mapping)


core\services\database\provider\ZMPdoDatabase.php at line 167

rollback

public void rollback()


core\services\database\provider\ZMPdoDatabase.php at line 558

translateRow

protected static array translateRow(array row, array mapping)

Translate a given raw database row with the given mapping.

Parameters:
row - The database row map.
mapping - The mapping (may be null).
Returns:
The mapped row.

core\services\database\provider\ZMPdoDatabase.php at line 413

update

public void update(mixed sql, mixed data)


core\services\database\provider\ZMPdoDatabase.php at line 357

updateModel

public void updateModel(mixed table, mixed model, mixed mapping)


ZenMagick 0.9.10