Path

ez components / documentation / api reference / 2009.2.1 / persistentobject


eZ Components 2009.2.1

PersistentObject: ezcPersistentFindWithRelationsQuery

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcPersistentFindWithRelationsQuery

Find query object for pre-fetching queries in ezcPersistentSessionIdentityDecorator. [source]
This query class extends ezcPersistentFindQuery with the possibility to define related objects to be pre-fretched. Do not instantiate this class directly, but use ezcPersistentIdentityDecorator::createFindQueryWithRelations() instead.

Parents

ezcPersistentFindQuery
   |
   --ezcPersistentFindWithRelationsQuery

Properties

bool read  $isRestricted
Whether the query has been restricted using a where() condition.

Inherited Member Variables

From ezcPersistentFindQuery:
protected  ezcPersistentFindQuery::$properties

Method Summary

public ezcPersistentFindWithRelationsQuery __construct( $query, $className, $relations )
Creates a new persistent find query.
public ezcQuerySelect where( $... )
Adds a where clause with logical expressions to the query.
public mixed __call( $methodName, $arguments )
Delegate to inner $query object.

Inherited Methods

From ezcPersistentFindQuery :
public ezcPersistentFindQuery ezcPersistentFindQuery::__construct()
Creates a new persistent find query.
public mixed ezcPersistentFindQuery::__call()
Delegate to inner $query object.

Methods

__construct

ezcPersistentFindWithRelationsQuery __construct( $query, string $className, $relations )
Creates a new persistent find query.
Creates a new persistent find query from the query object $q and the given $className. $relations defines, which related objects should be fetched by this query.

Parameters

Name Type Description
$query ezcQuerySelect  
$className string  
$relations array(string=>ezcPersistentRelationFindDefinition)  

See also:

ezcPerisistentSessionIdenityDecorator::createFindWithRelationsQuery().

Redefinition of

Method Description
ezcPersistentFindQuery::__construct() Creates a new persistent find query.

where

ezcQuerySelect where( string|array(string) $... )
Adds a where clause with logical expressions to the query.
where() accepts an arbitrary number of parameters. Each parameter must contain a logical expression or an array with logical expressions. If you specify multiple logical expression they are connected using a logical and.
Multiple calls to where() will join the expressions using a logical and.
Example:
 1.  $q->select'*' )->from'table' )->where$q->expr->eq'id') );
Note, if you add a WHERE clause to this query, the fetched related objects will not be fetched into the ezcPersistentIdentityMap used as a typical related object set, but as a named set.

Parameters

Name Type Description
$... string|array(string) Either a string with a logical expression name or an array with logical expressions.

Throws

ClassDescription
ezcQueryVariableParameterException if called with no parameters.

__call

mixed __call( string $methodName, array $arguments )
Delegate to inner $query object.
This query object does not allow any other calls than {where()} and {groupBy()}. Therefore, this method throws an exception, for any other call.

Parameters

Name Type Description
$methodName string  
$arguments array  

Throws

ClassDescription
RuntimeException For any call.

Redefinition of

Method Description
ezcPersistentFindQuery::__call() Delegate to inner $query object.

Last updated: Tue, 23 Mar 2010