RDBMapper Interface Reference

Detailed Description

RDBMapper defines the interface for mapper classes that map to relational databases.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 24 of file RDBMapper.php.

+ Inheritance diagram for RDBMapper:

Public Member Functions

 getConnection ()
 
 getAdapter ()
 
 getQuoteIdentifierSymbol ()
 
 quoteIdentifier ($identifier)
 
 quoteValue ($value)
 
 getRealTableName ()
 
 select (SelectStatement $selectStmt, PagingInfo $pagingInfo=null)
 
 constructOID ($data)
 
 renderCriteria (Criteria $criteria, $placeholder=null, $tableName=null, $columnName=null)
 
 loadObjectsFromSQL (SelectStatement $selectStmt, $buildDepth=BuildDepth::SINGLE, PagingInfo $pagingInfo=null, &$originalData=null)
 
- Public Member Functions inherited from PersistenceMapper
 getType ()
 
 getTypeDisplayName (Message $message)
 
 getTypeDescription (Message $message)
 
 getPkNames ()
 
 getRelations ($hierarchyType='all')
 
 hasRelation ($roleName)
 
 getRelation ($roleName)
 
 getRelationsByType ($type)
 
 getAttributes (array $tags=[], $matchMode='all')
 
 hasAttribute ($name)
 
 getAttribute ($name)
 
 getAttributeDisplayName ($name, Message $message)
 
 getAttributeDescription ($name, Message $message)
 
 getReferences ()
 
 getProperties ()
 
 isSortable ($roleName=null)
 
 getSortkey ($roleName=null)
 
 getDefaultOrder ($roleName=null)
 
 load (ObjectId $oid, $buildDepth=BuildDepth::SINGLE)
 
 create ($type, $buildDepth=BuildDepth::SINGLE)
 
 save (PersistentObject $object)
 
 delete (PersistentObject $object)
 
 getOIDs ($type, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadObjects ($type, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 loadRelation (array $objects, $role, $buildDepth=BuildDepth::SINGLE, $criteria=null, $orderby=null, PagingInfo $pagingInfo=null)
 
 executeOperation (PersistenceOperation $operation)
 
 beginTransaction ()
 
 commitTransaction ()
 
 rollbackTransaction ()
 
 getStatements ()
 

Member Function Documentation

getConnection ( )

Get the database connection.

Returns
PDOConnection

Implemented in AbstractRDBMapper.

getAdapter ( )

Get the database adapter.

Returns
Zend

Implemented in AbstractRDBMapper.

getQuoteIdentifierSymbol ( )

Get the symbol used to quote identifiers.

Returns
String

Implemented in AbstractRDBMapper.

quoteIdentifier (   $identifier)

Add quotation to a given identifier (like column name).

Parameters
$identifierThe identifier string
Returns
String

Implemented in AbstractRDBMapper.

quoteValue (   $value)

Add quotation to a given value.

Parameters
$valueThe value
Returns
String

Implemented in AbstractRDBMapper.

getRealTableName ( )

Get the table name with the dbprefix added.

Returns
The table name

Implemented in AbstractRDBMapper.

select ( SelectStatement  $selectStmt,
PagingInfo  $pagingInfo = null 
)

Execute a select query on the connection.

Parameters
$selectStmtA SelectStatement instance
$pagingInfoAn PagingInfo instance describing which page to load (optional, default: null)
Returns
An array as the result of PDOStatement::fetchAll(PDO::FETCH_ASSOC)

Implemented in AbstractRDBMapper.

constructOID (   $data)

Construct an object id from given row data.

Parameters
$dataAn associative array with the pk column names as keys and pk values as values
Returns
The oid

Implemented in AbstractRDBMapper.

renderCriteria ( Criteria  $criteria,
  $placeholder = null,
  $tableName = null,
  $columnName = null 
)

Render a Criteria instance as string.

Parameters
$criteriaThe Criteria instance
$placeholderPlaceholder (':columnName', '?') used instead of the value (optional, default: null)
$tableNameThe table name to use (may differ from criteria's type attribute) (optional)
$columnNameThe column name to use (may differ from criteria's attribute attribute) (optional)
Returns
Array with condition (string) and placeholder (string)

Implemented in AbstractRDBMapper.

loadObjectsFromSQL ( SelectStatement  $selectStmt,
  $buildDepth = BuildDepth::SINGLE,
PagingInfo  $pagingInfo = null,
$originalData = null 
)

Load objects defined by a select statement.

Parameters
$selectStmtA SelectStatement instance
$buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to build (except BuildDepth::REQUIRED, BuildDepth::PROXIES_ONLY) (default: BuildDepth::SINGLE)
$pagingInfoA reference PagingInfo instance (optional, default: null)
$originalDataA reference that will receive the original database data (optional)
Returns
Array of PersistentObject instances

Implemented in AbstractRDBMapper.