ZenMagick 0.9.6


org.zenmagick.database.provider.ZMCreoleDatabase

Class ZMCreoleDatabase

ZMObject
|
+--ZMCreoleDatabase
All Implemented Interfaces:
ZMDatabase

public class ZMCreoleDatabase
extends ZMObject

Implementation of the ZenMagick database layer using Creole.

See Also:
http://creole.phpdb.org/trac
Author:
DerManoMann
Version:
$Id: ZMCreoleDatabase.php 2217 2009-05-11 02:23:06Z dermanomann $

Fields inherited from org.zenmagick.ZMObject
properties_
Constructor Summary

ZMCreoleDatabase(array conf)

Create a new instance.

Method Summary
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} /

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 mixed

rs2model(string modelClass, ResultSet rs, array mapping)

Create model and populate using the given rs and field map.

void

update(mixed sql, mixed data)

{@inheritDoc} /

void

updateModel(mixed table, mixed model, mixed mapping)

{@inheritDoc} /

Methods inherited from org.zenmagick.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

ZMCreoleDatabase

public ZMCreoleDatabase(array conf)

Create a new instance.

Parameters:
conf - Configuration properties.

Method Detail

beginTransaction

public void beginTransaction()

/


commit

public void commit()

/


createModel

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

/


getConfig

public void getConfig()

/


getExecutionTime

protected long getExecutionTime(string start)

Get the elapsed time since $start.

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

getMetaData

public void getMetaData(mixed table)

/


getResource

public void getResource()

/


getStats

public void getStats()

/


loadModel

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

/


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;

query

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

/


querySingle

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

/


removeModel

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

/


rollback

public void rollback()

/


rs2model

protected mixed rs2model(string modelClass, ResultSet rs, array mapping)

Create model and populate using the given rs and field map.

Parameters:
modelClass - The model class.
rs - A Creole result set.
mapping - The field mapping.
Returns:
The model instance or array (if modelClass is null).

update

public void update(mixed sql, mixed data)

/


updateModel

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

/


ZenMagick 0.9.6