Detailed Description

AbstractQuery is the base class for all query classes.

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

Definition at line 27 of file AbstractQuery.php.

+ Inheritance diagram for AbstractQuery:

Public Member Functions

 execute ($buildDepth, $orderby=null, $pagingInfo=null)
 
 getQueryString ($buildDepth=BuildDepth::SINGLE, $orderby=null)
 
 getLastQueryString ()
 

Protected Member Functions

 getQueryType ()
 
 buildQuery ($buildDepth, $orderby=null, PagingInfo $pagingInfo=null)
 
 executeInternal (SelectStatement $selectStmt, $buildDepth, PagingInfo $pagingInfo=null)
 

Static Protected Member Functions

static getConnection ($type)
 
static getMapper ($type)
 
static checkMapper (PersistenceMapper $mapper)
 

Member Function Documentation

getQueryType ( )
abstractprotected

Get the name of the type that should be queried.

Returns
String
execute (   $buildDepth,
  $orderby = null,
  $pagingInfo = null 
)

Execute the query.

Parameters
$buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to load (except BuildDepth::REQUIRED) or false if only object ids should be returned
$orderbyAn array holding names of attributes to order by, maybe appended with 'ASC', 'DESC' (maybe null) (default: null)
$pagingInfoA reference paging info instance (optional, default: null)
Returns
A list of objects that match the given conditions or a list of object ids

Definition at line 45 of file AbstractQuery.php.

getQueryString (   $buildDepth = BuildDepth::SINGLE,
  $orderby = null 
)

Get the query serialized to a string.

Placeholder are replaced with quoted values.

Parameters
$buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to load (except BuildDepth::REQUIRED) or false if only object ids should be returned (optional, default: BuildDepth::SINGLE)
$orderbyAn array holding names of attributes to order by, maybe appended with 'ASC', 'DESC' (optional, default: null)
Returns
String

Definition at line 59 of file AbstractQuery.php.

getLastQueryString ( )

Get the query last executed serialized to a string.

Returns
String

Definition at line 75 of file AbstractQuery.php.

buildQuery (   $buildDepth,
  $orderby = null,
PagingInfo  $pagingInfo = null 
)
abstractprotected

Build the query.

Parameters
$buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to load (except BuildDepth::REQUIRED) or false if only object ids should be returned
$orderbyAn array holding names of attributes to order by, maybe appended with 'ASC', 'DESC' (optional, default: null)
$pagingInfoA reference paging info instance (optional, default: null)
Returns
SelectStatement instance
executeInternal ( SelectStatement  $selectStmt,
  $buildDepth,
PagingInfo  $pagingInfo = null 
)
protected

Execute the query and return the results.

Parameters
$selectStmtA SelectStatement instance
$buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to load (except BuildDepth::REQUIRED) or false if only object ids should be returned
$pagingInfoA reference paging info instance (default: null)
Returns
A list of objects that match the given conditions or a list of object ids

Definition at line 100 of file AbstractQuery.php.

static getConnection (   $type)
staticprotected

Get the database connection of the given node type.

Parameters
$typeThe node type to get the connection from connection
Returns
The connection

Definition at line 150 of file AbstractQuery.php.

static getMapper (   $type)
staticprotected

Get the mapper for a Node and check if it is a supported one.

Parameters
$typeThe type of Node to get the mapper for
Returns
RDBMapper instance

Definition at line 161 of file AbstractQuery.php.

static checkMapper ( PersistenceMapper  $mapper)
staticprotected

Check if a mapper is a supported one.

Parameters
$mapperPersistenceMapper instance
Exceptions
PersistenceException

Definition at line 173 of file AbstractQuery.php.