class BaseModelCriteria extends Criteria implements IteratorAggregate
Constants
EQUAL |
Comparison type. |
NOT_EQUAL |
Comparison type. |
ALT_NOT_EQUAL |
Comparison type. |
GREATER_THAN |
Comparison type. |
LESS_THAN |
Comparison type. |
GREATER_EQUAL |
Comparison type. |
LESS_EQUAL |
Comparison type. |
LIKE |
Comparison type. |
NOT_LIKE |
Comparison type. |
CONTAINS_ALL |
Comparison for array column types |
CONTAINS_SOME |
Comparison for array column types |
CONTAINS_NONE |
Comparison for array column types |
ILIKE |
PostgreSQL comparison type |
NOT_ILIKE |
PostgreSQL comparison type |
CUSTOM |
Comparison type. |
RAW |
Comparison type |
CUSTOM_EQUAL |
Comparison type for update |
DISTINCT |
Comparison type. |
IN |
Comparison type. |
NOT_IN |
Comparison type. |
ALL |
Comparison type. |
JOIN |
Comparison type. |
BINARY_AND |
Binary math operator: AND |
BINARY_OR |
Binary math operator: OR |
ASC |
'Order by' qualifier - ascending |
DESC |
'Order by' qualifier - descending |
ISNULL |
'IS NULL' null comparison |
ISNOTNULL |
'IS NOT NULL' null comparison |
CURRENT_DATE |
'CURRENT_DATE' ANSI SQL function |
CURRENT_TIME |
'CURRENT_TIME' ANSI SQL function |
CURRENT_TIMESTAMP |
'CURRENT_TIMESTAMP' ANSI SQL function |
LEFT_JOIN |
'LEFT JOIN' SQL statement |
RIGHT_JOIN |
'RIGHT JOIN' SQL statement |
INNER_JOIN |
'INNER JOIN' SQL statement |
LOGICAL_OR |
logical OR operator |
LOGICAL_AND |
logical AND operator |
Methods
__construct(string $dbName = null, string $modelName = null, string $modelAlias = null)
Creates a new instance with the default capacity which corresponds to the specified database. |
||
array |
getMap()
Get the criteria map, i.e. |
from Criteria |
void |
clear()
Brings this criteria back to its initial state, so that it can be reused as if it was new. |
from Criteria |
Criteria |
addAsColumn(string $name, string $clause)
Add an AS clause to the select columns. |
from Criteria |
array |
getAsColumns()
Get the column aliases. |
from Criteria |
string |
getColumnForAs($as)
Returns the column name associated with an alias (AS-column). |
from Criteria |
Criteria |
addAlias(string $alias, string $table)
Allows one to specify an alias for a table that can be used in various parts of the SQL. |
from Criteria |
Criteria |
removeAlias(string $alias)
Remove an alias for a table (useful when merging Criterias). |
from Criteria |
array |
getAliases()
Returns the aliases for this Criteria |
from Criteria |
string |
getTableForAlias(string $alias)
Returns the table name associated with an alias. |
from Criteria |
array($tableName, |
getTableNameAndAlias(string $tableAliasOrName)
Returns the table name and alias based on a table alias or name. |
from Criteria |
array |
keys()
Get the keys of the criteria map, i.e. |
from Criteria |
boolean |
containsKey(string $column)
Does this Criteria object contain the specified key? |
from Criteria |
boolean |
keyContainsValue(string $column)
Does this Criteria object contain the specified key and does it have a value set for the key |
from Criteria |
boolean |
hasWhereClause()
Whether this Criteria has any where columns. |
from Criteria |
void |
setUseTransaction($v)
Will force the sql represented by this criteria to be executed within a transaction. |
from Criteria |
boolean |
isUseTransaction()
Whether the sql command specified by this criteria must be wrapped in a transaction. |
from Criteria |
AbstractCriterion |
getCriterion(string $column)
Method to return criteria related to columns in a table. |
from Criteria |
AbstractCriterion |
getLastCriterion()
Method to return the latest Criterion in a table. |
from Criteria |
AbstractCriterion |
getNewCriterion(string $column, mixed $value = null, string $comparison = self::EQUAL)
Method to return a Criterion that is not added automatically to this Criteria. |
from Criteria |
string |
getColumnName(string $name)
Method to return a String table name. |
from Criteria |
array |
getTablesColumns()
Shortcut method to get an array of columns indexed by table. |
from Criteria |
string |
getComparison(string $key)
Method to return a comparison String. |
from Criteria |
string |
getDbName()
Get the Database(Map) name. |
from Criteria |
void |
setDbName(string $dbName = null)
Set the DatabaseMap name. |
from Criteria |
string |
getPrimaryTableName()
Get the primary table for this Criteria. |
from Criteria |
setPrimaryTableName($tableName)
Sets the primary table for this Criteria. |
from Criteria | |
string |
getTableName(string $name)
Method to return a String table name. |
from Criteria |
mixed |
getValue(string $name)
Method to return the value that was added to Criteria. |
from Criteria |
mixed |
get(string $key)
An alias to getValue() -- exposing a Hashtable-like interface. |
from Criteria |
Instance |
put(string $key, mixed $value)
Overrides Hashtable put, so that this object is returned instead of the value previously in the Criteria object. |
from Criteria |
putAll(mixed $t)
Copies all of the mappings from the specified Map to this Criteria These mappings will replace any mappings that this Criteria had for any of the keys currently in the specified Map. |
from Criteria | |
A |
add($p1, $value = null, $comparison = null)
This method adds a new criterion to the list of criterias. |
from Criteria |
string | __toString() | from Criteria |
A |
addCond(string $name, string $p1, mixed $value = null, string $comparison = null)
This method creates a new criterion but keeps it for later use with combine() Until combine() is called, the condition is not added to the query |
from Criteria |
combine(array $criterions = array(), string $operator = self::LOGICAL_AND, string $name = null)
Combine several named criterions with a logical operator |
from Criteria | |
Criteria |
addJoin(mixed $left, mixed $right, mixed $joinType = null)
This is the way that you should add a join of two tables. |
from Criteria |
Criteria |
addMultipleJoin(array $conditions, string $joinType = null)
Add a join with multiple conditions |
from Criteria |
Criteria |
addJoinObject(Join $join)
Add a join object to the Criteria |
from Criteria |
array |
getJoins()
Get the array of Joins. |
from Criteria |
Criteria |
addSelectQuery(Criteria $subQueryCriteria, string $alias = null)
Adds a Criteria as subQuery in the From Clause. |
from Criteria |
boolean |
hasSelectQueries()
Checks whether this Criteria has a subquery. |
from Criteria |
array |
getSelectQueries()
Get the associative array of Criteria for the subQueries per alias. |
from Criteria |
Criteria |
getSelectQuery(string $alias)
Get the Criteria for a specific subQuery. |
from Criteria |
boolean |
hasSelectQuery(string $alias)
checks if the Criteria for a specific subQuery is set. |
from Criteria |
forgeSelectQueryAlias() | from Criteria | |
Criteria |
setAll()
Adds 'ALL' modifier to the SQL statement. |
from Criteria |
Criteria |
setDistinct()
Adds 'DISTINCT' modifier to the SQL statement. |
from Criteria |
Criteria |
addSelectModifier(string $modifier)
Adds a modifier to the SQL statement. |
from Criteria |
Criteria |
removeSelectModifier(string $modifier)
Removes a modifier to the SQL statement. |
from Criteria |
boolean |
hasSelectModifier(string $modifier)
Checks the existence of a SQL select modifier |
from Criteria |
Criteria |
setIgnoreCase(boolean $b)
Sets ignore case. |
from Criteria |
boolean |
isIgnoreCase()
Is ignore case on or off? |
from Criteria |
Criteria |
setSingleRecord(boolean $b)
Set single record? Set this to <code>true</code> if you expect the query to result in only a single result record (the default behaviour is to throw a PropelException if multiple records are returned when the query is executed). |
from Criteria |
boolean |
isSingleRecord()
Is single record? |
from Criteria |
Criteria |
setLimit(int $limit)
Set limit. |
from Criteria |
int |
getLimit()
Get limit. |
from Criteria |
Criteria |
setOffset(int $offset)
Set offset. |
from Criteria |
int |
getOffset()
Get offset. |
from Criteria |
Criteria |
addSelectColumn(string $name)
Add select column. |
from Criteria |
Criteria |
setComment(string $comment = null)
Set the query comment, that appears after the first verb in the SQL query |
from Criteria |
string |
getComment()
Get the query comment, that appears after the first verb in the SQL query |
from Criteria |
boolean |
hasSelectClause()
Whether this Criteria has any select columns. |
from Criteria |
array |
getSelectColumns()
Get select columns. |
from Criteria |
Criteria |
clearSelectColumns()
Clears current select columns. |
from Criteria |
An |
getSelectModifiers()
Get select modifiers. |
from Criteria |
A |
addGroupByColumn(string $groupBy)
Add group by column name. |
from Criteria |
A |
addAscendingOrderByColumn(string $name)
Add order by column name, explicitly specifying ascending. |
from Criteria |
Criteria |
addDescendingOrderByColumn(string $name)
Add order by column name, explicitly specifying descending. |
from Criteria |
array |
getOrderByColumns()
Get order by columns. |
from Criteria |
Criteria |
clearOrderByColumns()
Clear the order-by columns. |
from Criteria |
Criteria |
clearGroupByColumns()
Clear the group-by columns. |
from Criteria |
array |
getGroupByColumns()
Get group by columns. |
from Criteria |
AbstractCriterion |
getHaving()
Get Having Criterion. |
from Criteria |
mixed |
remove(string $key)
Remove an object from the criteria. |
from Criteria |
string |
toString()
Build a string representation of the Criteria. |
from Criteria |
int |
size()
Returns the size (count) of this criteria. |
from Criteria |
boolean |
equals($crit)
This method checks another Criteria to see if they contain the same attributes and hashtable entries. |
from Criteria |
Criteria |
mergeWith(Criteria $criteria, string $operator = null)
Add the content of a Criteria to the current Criteria In case of conflict, the current Criteria keeps its properties |
from Criteria |
A |
addHaving(mixed $p1, mixed $value = null, mixed $comparison = null)
This method adds a prepared Criterion object to the Criteria as a having clause. |
from Criteria |
Criteria |
addAnd($p1, $p2 = null, $p3 = null, $preferColumnCondition = true)
If a criterion for the requested column already exists, the condition is "AND"ed to the existing criterion (necessary for Propel 1.4 compatibility). |
from Criteria |
Criteria |
addOr($p1, $p2 = null, $p3 = null, $preferColumnCondition = true)
If a prior criterion exists, the condition is "OR"ed to it. |
from Criteria |
Criteria |
addUsingOperator(string|AbstractCriterion $p1, mixed $value = null, string $operator = null, boolean $preferColumnCondition = true)
Overrides Criteria::add() to use the default combine operator |
from Criteria |
string |
createSelectSql(array $params)
Method to create an SQL query based on values in a Criteria. |
from Criteria |
mixed |
doInsert(ConnectionInterface $con = null)
Method to perform inserts based on values and keys in a Criteria. |
from Criteria |
getPrimaryKey(Criteria $criteria = null) | from Criteria | |
int |
doUpdate(Criteria $updateValues, ConnectionInterface $con)
Method used to update rows in the DB. |
from Criteria |
buildParams($columns, Criteria $values = null) | from Criteria | |
doCount($con = null) | from Criteria | |
needsSelectAliases()
Checks whether the Criteria needs to use column aliasing This is implemented in a service class rather than in Criteria itself in order to avoid doing the tests when it's not necessary (e.g. |
from Criteria | |
int |
doDelete(ConnectionInterface $con = null)
Issue a DELETE query based on the current ModelCriteria This method is called by ModelCriteria::delete() inside a transaction |
from Criteria |
DataFetcherInterface |
doSelect($con $con = null)
Builds, binds and executes a SELECT query based on the current object. |
from Criteria |
_or() | from Criteria | |
_and() | from Criteria | |
PropelConditionalProxy|Criteria |
_if(boolean $cond)
Returns the current object if the condition is true, or a PropelConditionalProxy instance otherwise. |
from Criteria |
PropelConditionalProxy|Criteria |
_elseif(boolean $cond)
Returns a PropelConditionalProxy instance. |
from Criteria |
PropelConditionalProxy|Criteria |
_else()
Returns a PropelConditionalProxy instance. |
from Criteria |
Criteria |
_endif()
Returns the current object Allows for conditional statements in a fluid interface. |
from Criteria |
__clone()
Ensures deep cloning of attached objects |
from Criteria | |
array |
getWith()
Gets the array of ModelWith specifying which objects must be hydrated together with the main object. |
|
ModelCriteria |
setWith(array $with)
Sets the array of ModelWith specifying which objects must be hydrated together with the main object. |
|
ModelCriteria |
setFormatter(string|AbstractFormatter $formatter)
Sets the formatter to use for the find() output Formatters must extend AbstractFormatter Use the ModelCriteria constants for class names: <code> $c->setFormatter(ModelCriteria::FORMAT_ARRAY); </code> |
|
AbstractFormatter |
getFormatter()
Gets the formatter to use for the find() output Defaults to an instance of ModelCriteria::$defaultFormatterClass, i.e. |
|
string |
getModelName()
Returns the name of the class for this model criteria |
|
ModelCriteria |
setModelName(string $modelName)
Sets the model name. |
|
getFullyQualifiedModelName() | ||
ModelCriteria |
setModelAlias(string $modelAlias, boolean $useAliasInSQL = false)
Sets the alias for the model in this query |
|
string |
getModelAlias()
Returns the alias of the main class for this model criteria |
|
string |
getModelAliasOrName()
Return the string to use in a clause as a model prefix for the main model |
|
string |
getModelShortName()
Return The short model name (the short ClassName for class with namespace) |
|
TableMap |
getTableMap()
Returns the TableMap object for this Criteria |
|
Traversable |
getIterator()
Execute the query with a find(), and return a Traversable object. |
Details
at line 36
public
__construct(string $dbName = null, string $modelName = null, string $modelAlias = null)
Creates a new instance with the default capacity which corresponds to the specified database.
in Criteria at line 273
public array
getMap()
Get the criteria map, i.e.
the array of Criterions
in Criteria at line 284
public void
clear()
Brings this criteria back to its initial state, so that it can be reused as if it was new.
Except if the criteria has grown in
capacity, it is left at the current capacity.
in Criteria at line 322
public Criteria
addAsColumn(string $name, string $clause)
Add an AS clause to the select columns.
Usage:
<code>
Criteria myCrit = new Criteria();
myCrit->addAsColumn('alias', 'ALIAS('.MyTableMap::ID.')');
</code>
If the name already exists, it is replaced by the new clause.
in Criteria at line 335
public array
getAsColumns()
Get the column aliases.
in Criteria at line 346
public string
getColumnForAs($as)
Returns the column name associated with an alias (AS-column).
in Criteria at line 362
public Criteria
addAlias(string $alias, string $table)
Allows one to specify an alias for a table that can be used in various parts of the SQL.
in Criteria at line 376
public Criteria
removeAlias(string $alias)
Remove an alias for a table (useful when merging Criterias).
in Criteria at line 388
public array
getAliases()
Returns the aliases for this Criteria
in Criteria at line 399
public string
getTableForAlias(string $alias)
Returns the table name associated with an alias.
in Criteria at line 414
public array($tableName,
getTableNameAndAlias(string $tableAliasOrName)
Returns the table name and alias based on a table alias or name.
Use this method to get the details of a table name that comes in a clause,
which can be either a table name or an alias name.
in Criteria at line 432
public array
keys()
Get the keys of the criteria map, i.e.
the list of columns bearing a condition
<code>
print_r($c->keys());
=> array('book.price', 'book.title', 'author.first_name')
</code>
in Criteria at line 443
public boolean
containsKey(string $column)
Does this Criteria object contain the specified key?
in Criteria at line 456
public boolean
keyContainsValue(string $column)
Does this Criteria object contain the specified key and does it have a value set for the key
in Criteria at line 471
public boolean
hasWhereClause()
Whether this Criteria has any where columns.
This counts conditions added with the add() method.
in Criteria at line 483
public void
setUseTransaction($v)
Will force the sql represented by this criteria to be executed within a transaction.
This is here primarily to support the oid type in
postgresql. Though it can be used to require any single sql statement
to use a transaction.
in Criteria at line 494
public boolean
isUseTransaction()
Whether the sql command specified by this criteria must be wrapped in a transaction.
in Criteria at line 508
public AbstractCriterion
getCriterion(string $column)
Method to return criteria related to columns in a table.
Make sure you call containsKey($column) prior to calling this method,
since no check on the existence of the $column is made in this method.
in Criteria at line 518
public AbstractCriterion
getLastCriterion()
Method to return the latest Criterion in a table.
in Criteria at line 539
public AbstractCriterion
getNewCriterion(string $column, mixed $value = null, string $comparison = self::EQUAL)
Method to return a Criterion that is not added automatically to this Criteria.
This can be used to chain the
Criterions to form a more complex where clause.
in Criteria at line 577
public string
getColumnName(string $name)
Method to return a String table name.
in Criteria at line 598
public array
getTablesColumns()
Shortcut method to get an array of columns indexed by table.
<code>
print_r($c->getTablesColumns());
=> array(
'book' => array('book.price', 'book.title'),
'author' => array('author.first_name')
)
</code>
in Criteria at line 615
public string
getComparison(string $key)
Method to return a comparison String.
in Criteria at line 629
public string
getDbName()
Get the Database(Map) name.
in Criteria at line 641
public void
setDbName(string $dbName = null)
Set the DatabaseMap name.
If <code>null</code> is supplied, uses value
provided by <code>Configuration::getDefaultDatasource()</code>.
in Criteria at line 655
public string
getPrimaryTableName()
Get the primary table for this Criteria.
This is useful for cases where a Criteria may not contain
any SELECT columns or WHERE columns. This must be explicitly
set, of course, in order to be useful.
in Criteria at line 669
public
setPrimaryTableName($tableName)
Sets the primary table for this Criteria.
This is useful for cases where a Criteria may not contain
any SELECT columns or WHERE columns. This must be explicitly
set, of course, in order to be useful.
in Criteria at line 680
public string
getTableName(string $name)
Method to return a String table name.
in Criteria at line 695
public mixed
getValue(string $name)
Method to return the value that was added to Criteria.
in Criteria at line 710
public mixed
get(string $key)
An alias to getValue() -- exposing a Hashtable-like interface.
in Criteria at line 729
public Instance
put(string $key, mixed $value)
Overrides Hashtable put, so that this object is returned instead of the value previously in the Criteria object.
The reason is so that it more closely matches the behavior
of the add() methods. If you want to get the previous value
then you should first Criteria.get() it yourself. Note, if
you attempt to pass in an Object that is not a String, it will
throw a NPE. The reason for this is that none of the add()
methods support adding anything other than a String as a key.
in Criteria at line 744
public
putAll(mixed $t)
Copies all of the mappings from the specified Map to this Criteria These mappings will replace any mappings that this Criteria had for any of the keys currently in the specified Map.
if the map was another Criteria, its attributes are copied to this
Criteria, overwriting previous settings.
in Criteria at line 780
public A
add($p1, $value = null, $comparison = null)
This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
replaced. If is used as follow:
<code>
$crit = new Criteria();
$crit->add($column, $value, Criteria::GREATER_THAN);
</code>
Any comparison can be used.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'.
in Criteria at line 794
public string
__toString()
in Criteria at line 822
public A
addCond(string $name, string $p1, mixed $value = null, string $comparison = null)
This method creates a new criterion but keeps it for later use with combine() Until combine() is called, the condition is not added to the query
<code>
$crit = new Criteria();
$crit->addCond('cond1', $column1, $value1, Criteria::GREATER_THAN);
$crit->addCond('cond2', $column2, $value2, Criteria::EQUAL);
$crit->combine(array('cond1', 'cond2'), Criteria::LOGICAL_OR);
</code>
Any comparison can be used.
The name of the table must be used implicitly in the column name,
so the Column name must be something like 'TABLE.id'.
in Criteria at line 836
public
combine(array $criterions = array(), string $operator = self::LOGICAL_AND, string $name = null)
Combine several named criterions with a logical operator
in Criteria at line 877
public Criteria
addJoin(mixed $left, mixed $right, mixed $joinType = null)
This is the way that you should add a join of two tables.
Example usage:
<code>
$c->addJoin(ProjectTableMap::ID, FooTableMap::PROJECT_ID, Criteria::LEFT_JOIN);
// LEFT JOIN FOO ON (PROJECT.ID = FOO.PROJECT_ID)
</code>
in Criteria at line 934
public Criteria
addMultipleJoin(array $conditions, string $joinType = null)
Add a join with multiple conditions
in Criteria at line 993
public Criteria
addJoinObject(Join $join)
Add a join object to the Criteria
in Criteria at line 1006
public array
getJoins()
Get the array of Joins.
in Criteria at line 1019
public Criteria
addSelectQuery(Criteria $subQueryCriteria, string $alias = null)
Adds a Criteria as subQuery in the From Clause.
in Criteria at line 1034
public boolean
hasSelectQueries()
Checks whether this Criteria has a subquery.
in Criteria at line 1044
public array
getSelectQueries()
Get the associative array of Criteria for the subQueries per alias.
in Criteria at line 1055
public Criteria
getSelectQuery(string $alias)
Get the Criteria for a specific subQuery.
in Criteria at line 1066
public boolean
hasSelectQuery(string $alias)
checks if the Criteria for a specific subQuery is set.
in Criteria at line 1071
public
forgeSelectQueryAlias()
in Criteria at line 1085
public Criteria
setAll()
Adds 'ALL' modifier to the SQL statement.
in Criteria at line 1097
public Criteria
setDistinct()
Adds 'DISTINCT' modifier to the SQL statement.
in Criteria at line 1113
public Criteria
addSelectModifier(string $modifier)
Adds a modifier to the SQL statement.
e.g. self::ALL, self::DISTINCT, 'SQL_CALC_FOUND_ROWS', 'HIGH_PRIORITY', etc.
in Criteria at line 1131
public Criteria
removeSelectModifier(string $modifier)
Removes a modifier to the SQL statement.
Checks for existence before removal
in Criteria at line 1145
public boolean
hasSelectModifier(string $modifier)
Checks the existence of a SQL select modifier
in Criteria at line 1156
public Criteria
setIgnoreCase(boolean $b)
Sets ignore case.
in Criteria at line 1168
public boolean
isIgnoreCase()
Is ignore case on or off?
in Criteria at line 1185
public Criteria
setSingleRecord(boolean $b)
Set single record? Set this to <code>true</code> if you expect the query to result in only a single result record (the default behaviour is to throw a PropelException if multiple records are returned when the query is executed).
This should be used in situations where returning multiple
rows would indicate an error of some sort. If your query might return
multiple records but you are only interested in the first one then you
should be using setLimit(1).
in Criteria at line 1197
public boolean
isSingleRecord()
Is single record?
in Criteria at line 1208
public Criteria
setLimit(int $limit)
Set limit.
in Criteria at line 1221
public int
getLimit()
Get limit.
in Criteria at line 1233
public Criteria
setOffset(int $offset)
Set offset.
in Criteria at line 1245
public int
getOffset()
Get offset.
in Criteria at line 1256
public Criteria
addSelectColumn(string $name)
Add select column.
in Criteria at line 1269
public Criteria
setComment(string $comment = null)
Set the query comment, that appears after the first verb in the SQL query
in Criteria at line 1281
public string
getComment()
Get the query comment, that appears after the first verb in the SQL query
in Criteria at line 1295
public boolean
hasSelectClause()
Whether this Criteria has any select columns.
This will include columns added with addAsColumn() method.
in Criteria at line 1305
public array
getSelectColumns()
Get select columns.
in Criteria at line 1315
public Criteria
clearSelectColumns()
Clears current select columns.
in Criteria at line 1327
public An
getSelectModifiers()
Get select modifiers.
in Criteria at line 1338
public A
addGroupByColumn(string $groupBy)
Add group by column name.
in Criteria at line 1351
public A
addAscendingOrderByColumn(string $name)
Add order by column name, explicitly specifying ascending.
in Criteria at line 1364
public Criteria
addDescendingOrderByColumn(string $name)
Add order by column name, explicitly specifying descending.
in Criteria at line 1376
public array
getOrderByColumns()
Get order by columns.
in Criteria at line 1386
public Criteria
clearOrderByColumns()
Clear the order-by columns.
in Criteria at line 1398
public Criteria
clearGroupByColumns()
Clear the group-by columns.
in Criteria at line 1410
public array
getGroupByColumns()
Get group by columns.
in Criteria at line 1420
public AbstractCriterion
getHaving()
Get Having Criterion.
in Criteria at line 1431
public mixed
remove(string $key)
Remove an object from the criteria.
in Criteria at line 1449
public string
toString()
Build a string representation of the Criteria.
in Criteria at line 1476
public int
size()
Returns the size (count) of this criteria.
in Criteria at line 1486
public boolean
equals($crit)
This method checks another Criteria to see if they contain the same attributes and hashtable entries.
in Criteria at line 1557
public Criteria
mergeWith(Criteria $criteria, string $operator = null)
Add the content of a Criteria to the current Criteria In case of conflict, the current Criteria keeps its properties
in Criteria at line 1652
public A
addHaving(mixed $p1, mixed $value = null, mixed $comparison = null)
This method adds a prepared Criterion object to the Criteria as a having clause.
You can get a new, empty Criterion object with the
getNewCriterion() method.
<p>
<code>
$crit = new Criteria();
$c = $crit->getNewCriterion(BaseTableMap::ID, 5, Criteria::LESS_THAN);
$crit->addHaving($c);
</code>
in Criteria at line 1706
public Criteria
addAnd($p1, $p2 = null, $p3 = null, $preferColumnCondition = true)
If a criterion for the requested column already exists, the condition is "AND"ed to the existing criterion (necessary for Propel 1.4 compatibility).
If no criterion for the requested column already exists, the condition is "AND"ed to the latest criterion.
If no criterion exist, the condition is added a new criterion
Any comparison can be used.
Supports a number of different signatures:
- addAnd(column, value, comparison)
- addAnd(column, value)
- addAnd(Criterion)
in Criteria at line 1736
public Criteria
addOr($p1, $p2 = null, $p3 = null, $preferColumnCondition = true)
If a prior criterion exists, the condition is "OR"ed to it.
If no criterion exist, the condition is added a new criterion
Any comparison can be used.
Supports a number of different signatures:
- addOr(column, value, comparison)
- addOr(column, value)
- addOr(Criterion)
in Criteria at line 1766
public Criteria
addUsingOperator(string|AbstractCriterion $p1, mixed $value = null, string $operator = null, boolean $preferColumnCondition = true)
Overrides Criteria::add() to use the default combine operator
in Criteria at line 1790
public string
createSelectSql(array $params)
Method to create an SQL query based on values in a Criteria.
This method creates only prepared statement SQL (using ? where values
will go). The second parameter ($params) stores the values that need
to be set before the statement is executed. The reason we do it this way
is to let the PDO layer handle all escaping & value formatting.
in Criteria at line 2007
public mixed
doInsert(ConnectionInterface $con = null)
Method to perform inserts based on values and keys in a Criteria.
<p>
If the primary key is auto incremented the data in Criteria
will be inserted and the auto increment value will be returned.
<p>
If the primary key is included in Criteria then that value will
be used to insert the row.
<p>
If no primary key is included in Criteria then we will try to
figure out the primary key from the database map and insert the
row with the next available id using util.db.IDBroker.
<p>
If no primary key is defined for the table the values will be
inserted as specified in Criteria and null will be returned.
in Criteria at line 2103
public
getPrimaryKey(Criteria $criteria = null)
in Criteria at line 2147
public int
doUpdate(Criteria $updateValues, ConnectionInterface $con)
Method used to update rows in the DB.
Rows are selected based
on selectCriteria and updated using values in updateValues.
<p>
Use this method for performing an update of the kind:
<p>
WHERE some_column = some value AND could_have_another_column =
another value AND so on.
in Criteria at line 2272
public
buildParams($columns, Criteria $values = null)
in Criteria at line 2292
public
doCount($con = null)
in Criteria at line 2341
public
needsSelectAliases()
Checks whether the Criteria needs to use column aliasing This is implemented in a service class rather than in Criteria itself in order to avoid doing the tests when it's not necessary (e.g.
for SELECTs)
in Criteria at line 2367
public int
doDelete(ConnectionInterface $con = null)
Issue a DELETE query based on the current ModelCriteria This method is called by ModelCriteria::delete() inside a transaction
in Criteria at line 2429
public DataFetcherInterface
doSelect($con $con = null)
Builds, binds and executes a SELECT query based on the current object.
in Criteria at line 2456
public
_or()
in Criteria at line 2463
public
_and()
in Criteria at line 2481
public PropelConditionalProxy|Criteria
_if(boolean $cond)
Returns the current object if the condition is true, or a PropelConditionalProxy instance otherwise.
Allows for conditional statements in a fluid interface.
in Criteria at line 2496
public PropelConditionalProxy|Criteria
_elseif(boolean $cond)
Returns a PropelConditionalProxy instance.
Allows for conditional statements in a fluid interface.
in Criteria at line 2511
public PropelConditionalProxy|Criteria
_else()
Returns a PropelConditionalProxy instance.
Allows for conditional statements in a fluid interface.
in Criteria at line 2526
public Criteria
_endif()
Returns the current object Allows for conditional statements in a fluid interface.
in Criteria at line 2545
public
__clone()
Ensures deep cloning of attached objects
at line 51
public array
getWith()
Gets the array of ModelWith specifying which objects must be hydrated together with the main object.
at line 64
public ModelCriteria
setWith(array $with)
Sets the array of ModelWith specifying which objects must be hydrated together with the main object.
at line 84
public ModelCriteria
setFormatter(string|AbstractFormatter $formatter)
Sets the formatter to use for the find() output Formatters must extend AbstractFormatter Use the ModelCriteria constants for class names: <code> $c->setFormatter(ModelCriteria::FORMAT_ARRAY); </code>
at line 105
public AbstractFormatter
getFormatter()
Gets the formatter to use for the find() output Defaults to an instance of ModelCriteria::$defaultFormatterClass, i.e.
PropelObjectsFormatter
at line 120
public string
getModelName()
Returns the name of the class for this model criteria
at line 133
public ModelCriteria
setModelName(string $modelName)
Sets the model name.
This also sets `this->modelTableMapName` and `this->tableMap`.
at line 150
public
getFullyQualifiedModelName()
at line 163
public ModelCriteria
setModelAlias(string $modelAlias, boolean $useAliasInSQL = false)
Sets the alias for the model in this query
at line 180
public string
getModelAlias()
Returns the alias of the main class for this model criteria
at line 190
public string
getModelAliasOrName()
Return the string to use in a clause as a model prefix for the main model
at line 200
public string
getModelShortName()
Return The short model name (the short ClassName for class with namespace)
at line 210
public TableMap
getTableMap()
Returns the TableMap object for this Criteria
at line 226
public Traversable
getIterator()
Execute the query with a find(), and return a Traversable object.
The return value depends on the query formatter. By default, this returns an ArrayIterator
constructed on a Propel\Runtime\Collection\PropelCollection.
Compulsory for implementation of \IteratorAggregate.