Class

SQLDAO

Abstract Package: mvc Author: loic rouchon <loic.rouchon@phpboost.com> Desc: Implements common access to a sql based datastore for CRUD operations on objects attached to the given MappingModel. Located at mvc/model/SQLDAO.class.php
SQLDAO implements DAO
Methods summary
public
# __construct( MappingModel $model, SQLQuerier $querier = null )
public
# save( PropertiesMapInterface $object )
public
# update( array $fields, string $where = DAO::WHERE_ALL, array $parameters = array() )
public
# delete( PropertiesMapInterface $object )
public
# delete_all( string $where = DAO::WHERE_ALL, array $parameters = array() )
public
# count( string $where = DAO::WHERE_ALL, array $parameters = array() )
public PropertiesMapInterface
# find_by_id( mixed $id )
public QueryResultMapper
# find_all( integer $limit = DAO::FIND_ALL, integer $offset = 0, string[mixed][] $order_by = array() )
public QueryResultMapper
# find_by_criteria( string $criteria, string[string] $parameters = array() )
Constants inherited from DAO
FIND_ALL, WHERE_ALL
Properties summary
protected DBQuerier $querier
#

the sql querier that will interact with the database

protected MappingModel $model
#

the model on which services are based

protected string $table
#

the name of the table in which objects will be stored

protected string $pk_db_field
#

the primary key database field name (prefixed by the table name)

protected string $pk_property
#

the primary key property

protected string $pk_getter
#

the primary key getter method name

protected string $pk_setter
#

the primary key setter method name

protected string[string] $fields_mapping array()
#

$fields_mapping[$property] => $db_field_name

protected string $delete_query
#

the delete prepared query

protected string $insert_query
#

the insert prepared query

protected string $update_query
#

the update prepared query

protected string $find_by_id_query
#

the find by id prepared query

protected string $find_by_criteria_query
#

the find by criteria prepared query