Detailed Description

StringQuery executes queries from a string representation.

Queries are constructed like WHERE clauses in sql, except that foreign key relations between the different types are not necessary. Attributes have to be prepended with the type name (or in case of ambiguity the role name), e.g. Author.name instead of name.

Note
: The query does not search in objects, that are created inside the current transaction.

The following example shows the usage:

$queryStr = "Author.name LIKE '%ingo%' AND (Recipe.name LIKE '%Salat%' OR Recipe.portions = 4)";
$query = new StringQuery('Author');
$query->setConditionString($queryStr);
$authorOIDs = $query->execute(false);
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 40 of file StringQuery.php.

+ Inheritance diagram for StringQuery:

Public Member Functions

 setConditionString ($condition)
 
- Public Member Functions inherited from ObjectQuery
 __construct ($type, $queryId=SelectStatement::NO_CACHE)
 
 __destruct ()
 
 getId ()
 
 getObjectTemplate ($type, $alias=null, $combineOperator=Criteria::OPERATOR_AND)
 
 registerObjectTemplate (Node $template, $alias=null, $combineOperator=Criteria::OPERATOR_AND)
 
 makeGroup ($templates, $combineOperator=Criteria::OPERATOR_AND)
 
 getQueryCondition ()
 
 valueChanged (ValueChangeEvent $event)
 
- Public Member Functions inherited from AbstractQuery
 execute ($buildDepth, $orderby=null, $pagingInfo=null)
 
 getQueryString ($orderby=null)
 
 getLastQueryString ()
 

Protected Member Functions

 buildQuery ($orderby=null, PagingInfo $pagingInfo=null)
 
- Protected Member Functions inherited from ObjectQuery
 getQueryType ()
 
 buildQuery ($orderby=null, PagingInfo $pagingInfo=null)
 
 processObjectTemplate (PersistentObject $tpl, SelectStatement $selectStmt)
 
 processOrderBy ($orderby, SelectStatement $selectStmt)
 
 getBind ($criteria, array $bindOrder)
 
 getBindPosition ($criterion, $criteria)
 
 resetInternals ()
 
 processTableName (Node $tpl)
 
- Protected Member Functions inherited from AbstractQuery
 getQueryType ()
 
 buildQuery ($orderby=null, PagingInfo $pagingInfo=null)
 
 executeInternal (SelectStatement $selectStmt, $buildDepth, PagingInfo $pagingInfo=null)
 

Static Protected Member Functions

static mapToDatabase ($type, $valueName)
 
- Static Protected Member Functions inherited from AbstractQuery
static getConnection ($type)
 
static getMapper ($type)
 
static checkMapper (PersistenceMapper $mapper)
 

Additional Inherited Members

- Public Attributes inherited from ObjectQuery
const PROPERTY_COMBINE_OPERATOR = "object_query_combine_operator"
 
const PROPERTY_TABLE_NAME = "object_query_table_name"
 
const PROPERTY_INITIAL_OID = "object_query_initial_oid"
 

Member Function Documentation

setConditionString (   $condition)

Set the query condition string.

Parameters
$conditionThe query definition string

Definition at line 48 of file StringQuery.php.

buildQuery (   $orderby = null,
PagingInfo  $pagingInfo = null 
)
protected
See also
AbstractQuery::buildQuery()

Definition at line 55 of file StringQuery.php.

static mapToDatabase (   $type,
  $valueName 
)
staticprotected

Map a application type and value name to the appropriate database names.

Parameters
$typeThe type to map
$valueNameThe name of the value to map
Returns
An array with the table and column name or null if no mapper is found

Definition at line 174 of file StringQuery.php.