[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/propel/util/ -> Criteria.php (sommaire)

(pas de description)

Poids: 1741 lignes (53 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 4 classes

Criteria:: (58 méthodes):
  __construct()
  getIterator()
  getMap()
  clear()
  addAsColumn()
  getAsColumns()
  getColumnForAs()
  addAlias()
  getTableForAlias()
  keys()
  containsKey()
  setUseTransaction()
  isUseTransaction()
  getCriterion()
  getNewCriterion()
  getColumnName()
  getTablesColumns()
  getComparison()
  getDbName()
  setDbName()
  getTableName()
  getValue()
  get()
  put()
  putAll()
  add()
  addJoin()
  getJoinL()
  getJoinR()
  setAll()
  setDistinct()
  setIgnoreCase()
  isIgnoreCase()
  setSingleRecord()
  isSingleRecord()
  setLimit()
  getLimit()
  setOffset()
  getOffset()
  addSelectColumn()
  getSelectColumns()
  clearSelectColumns()
  getSelectModifiers()
  addGroupByColumn()
  addAscendingOrderByColumn()
  addDescendingOrderByColumn()
  getOrderByColumns()
  clearOrderByColumns()
  clearGroupByColumns()
  getGroupByColumns()
  getHaving()
  remove()
  toString()
  size()
  equals()
  addHaving()
  addAnd()
  addOr()

CriterionIterator:: (6 méthodes):
  __construct()
  rewind()
  valid()
  key()
  current()
  next()

Criterion:: (22 méthodes):
  __construct()
  init()
  getColumn()
  setTable()
  getTable()
  getComparison()
  getValue()
  getDB()
  setDB()
  setIgnoreCase()
  isIgnoreCase()
  getClauses()
  getConjunctions()
  addAnd()
  addOr()
  appendPsTo()
  equals()
  hashCode()
  getAllTables()
  addCriterionTable()
  getAttachedCriterion()
  traverseCriterion()

Join:: (9 méthodes):
  __construct()
  getJoinType()
  getLeftColumn()
  getLeftColumnName()
  getLeftTableName()
  getRightColumn()
  getRightColumnName()
  getRightTableName()
  toString()


Classe: Criteria  - X-Ref

This is a utility class for holding criteria information for a query.

BasePeer constructs SQL statements based on the values in this class.

__construct($dbName = null)   X-Ref
Creates a new instance with the default capacity which corresponds to
the specified database.

param: dbName The dabase name.

getIterator()   X-Ref
Implementing SPL IteratorAggregate interface.  This allows
you to foreach() over a Criteria object.


getMap()   X-Ref
Get the criteria map.

return: array

clear()   X-Ref
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.

return: void

addAsColumn($name, $clause)   X-Ref
Add an AS clause to the select columns. Usage:

<code>
Criteria myCrit = new Criteria();
myCrit->addAsColumn("alias", "ALIAS(".MyPeer::ID.")");
</code>

param: string $name Wanted Name of the column (alias).
param: string $clause SQL clause to select from the table
return: Criteria A modified Criteria object.

getAsColumns()   X-Ref
Get the column aliases.

return: array An assoc array which map the column alias names

getColumnForAs($as)   X-Ref
Returns the column name associated with an alias (AS-column).

param: string $alias
return: string $string

addAlias($alias, $table)   X-Ref
Allows one to specify an alias for a table that can
be used in various parts of the SQL.

param: string $alias
param: string $table
return: void

getTableForAlias($alias)   X-Ref
Returns the table name associated with an alias.

param: string $alias
return: string $string

keys()   X-Ref
Get the keys for the criteria map.

return: array

containsKey($column)   X-Ref
Does this Criteria object contain the specified key?

param: string $column [table.]column
return: boolean True if this Criteria object contain the specified key.

setUseTransaction($v)   X-Ref
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.

return: void

isUseTransaction()   X-Ref
called by BasePeer to determine whether the sql command specified by
this criteria must be wrapped in a transaction.

return: a <code>boolean</code> value

getCriterion($column)   X-Ref
Method to return criteria related to columns in a table.

param: string $column Column name.
return: A Criterion or null if $column is invalid.

getNewCriterion($column, $value, $comparison = null)   X-Ref
Method to return criterion that is not added automatically
to this Criteria.  This can be used to chain the
Criterions to form a more complex where clause.

param: column String full name of column (for example TABLE.COLUMN).
param: mixed $value
param: string $comparison
return: A Criterion.

getColumnName($name)   X-Ref
Method to return a String table name.

param: name A String with the name of the key.
return: A String with the value of the object at key.

getTablesColumns()   X-Ref
Shortcut method to get an array of columns indexed by table.

return: array array(table => array(table.column1, table.column2))

getComparison($key)   X-Ref
Method to return a comparison String.

param: string $key String name of the key.
return: string A String with the value of the object at key.

getDbName()   X-Ref
Get the Database(Map) name.

return: string A String with the Database(Map) name.

setDbName($dbName = null)   X-Ref
Set the DatabaseMap name.  If <code>null</code> is supplied, uses value
provided by <code>Propel::getDefaultDB()</code>.

param: $dbName A String with the Database(Map) name.
return: void

getTableName($name)   X-Ref
Method to return a String table name.

param: $name A String with the name of the key.
return: string A String with the value of table for criterion at key.

getValue($name)   X-Ref
Method to return the value that was added to Criteria.

param: string $name A String with the name of the key.
return: mixed The value of object at key.

get($key)   X-Ref
An alias to getValue() -- exposing a Hashtable-like interface.

param: string $key An Object.
return: mixed The value within the Criterion (not the Criterion object).

put($key, $value)   X-Ref
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.

param: string $key
param: mixed $value
return: Instance of self.

putAll($t)   X-Ref
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.

param: mixed $t Mappings to be stored in this map.

add($p1, $value = null, $comparison = null)   X-Ref
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:

<p>
<code>
$crit = new Criteria();
$crit->add(&quot;column&quot;,
&quot;value&quot;
&quot;Criteria::GREATER_THAN&quot;);
</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'. If you
don't like this, you can use the add(table, column, value) method.

param: string $critOrColumn The column to run the comparison on, or Criterion object.
param: mixed $value
param: string $comparison A String.
return: A modified Criteria object.

addJoin($left, $right, $operator = null)   X-Ref
This is the way that you should add a straight (inner) join of two tables.  For
example:

<p>
AND PROJECT.PROJECT_ID=FOO.PROJECT_ID
<p>

left = PROJECT.PROJECT_ID
right = FOO.PROJECT_ID

param: string $left A String with the left side of the join.
param: string $right A String with the right side of the join.
param: string $operator A String with the join operator e.g. LEFT JOIN, ...
return: Criteria A modified Criteria object.

getJoinL()   X-Ref
Pas de description

getJoinR()   X-Ref
get one side of the set of possible joins.  This method is meant to
be called by BasePeer.

return: array

setAll()   X-Ref
Adds "ALL " to the SQL statement.

return: void

setDistinct()   X-Ref
Adds "DISTINCT " to the SQL statement.

return: void

setIgnoreCase($b)   X-Ref
Sets ignore case.

param: boolean $b True if case should be ignored.
return: A modified Criteria object.

isIgnoreCase()   X-Ref
Is ignore case on or off?

return: boolean True if case is ignored.

setSingleRecord($b)   X-Ref
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).

param: b set to <code>true</code> if you expect the query to select just
return: A modified Criteria object.

isSingleRecord()   X-Ref
Is single record?

return: boolean True if a single record is being returned.

setLimit($limit)   X-Ref
Set limit.

param: limit An int with the value for limit.
return: A modified Criteria object.

getLimit()   X-Ref
Get limit.

return: int An int with the value for limit.

setOffset($offset)   X-Ref
Set offset.

param: int $offset An int with the value for offset.
return: A modified Criteria object.

getOffset()   X-Ref
Get offset.

return: An int with the value for offset.

addSelectColumn($name)   X-Ref
Add select column.

param: name A String with the name of the select column.
return: A modified Criteria object.

getSelectColumns()   X-Ref
Get select columns.

return: array An array with the name of the select

clearSelectColumns()   X-Ref
Clears current select columns.

return: Criteria A modified Criteria object.

getSelectModifiers()   X-Ref
Get select modifiers.

return: An array with the select modifiers.

addGroupByColumn($groupBy)   X-Ref
Add group by column name.

param: string $groupBy The name of the column to group by.
return: A modified Criteria object.

addAscendingOrderByColumn($name)   X-Ref
Add order by column name, explicitly specifying ascending.

param: name The name of the column to order by.
return: A modified Criteria object.

addDescendingOrderByColumn($name)   X-Ref
Add order by column name, explicitly specifying descending.

param: string $name The name of the column to order by.
return: Criteria The modified Criteria object.

getOrderByColumns()   X-Ref
Get order by columns.

return: array An array with the name of the order columns.

clearOrderByColumns()   X-Ref
Clear the order-by columns.

return: Criteria

clearGroupByColumns()   X-Ref
Clear the group-by columns.

return: Criteria

getGroupByColumns()   X-Ref
Get group by columns.

return: array

getHaving()   X-Ref
Get Having Criterion.

return: Criterion A Criterion object that is the having clause.

remove($key)   X-Ref
Remove an object from the criteria.

param: string $key A string with the key to be removed.
return: mixed The removed value.

toString()   X-Ref
Build a string representation of the Criteria.

return: string A String with the representation of the Criteria.

size()   X-Ref
Returns the size (count) of this criteria.

return: int

equals($crit)   X-Ref
This method checks another Criteria to see if they contain
the same attributes and hashtable entries.

return: boolean

addHaving(Criterion $having)   X-Ref
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(BasePeer::ID, 5, Criteria::LESS_THAN);
$crit->addHaving($c);
</code>

param: having A Criterion object
return: A modified Criteria object.

addAnd($p1, $p2 = null, $p3 = null)   X-Ref
This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"AND"ed to the existing criterion.

addAnd(column, value, comparison)
<code>
$crit = $orig_crit->addAnd(&quot;column&quot;,
&quot;value&quot;
&quot;Criterion::GREATER_THAN&quot;);
</code>

addAnd(column, value)
<code>
$crit = $orig_crit->addAnd(&quot;column&quot;, &quot;value&quot;);
</code>

addAnd(Criterion)
<code>
$crit = new Criteria();
$c = $crit->getNewCriterion(BasePeer::ID, 5, Criteria::LESS_THAN);
$crit->addAnd($c);
</code>

Any comparison can be used, of course.


return: Criteria A modified Criteria object.

addOr($p1, $p2 = null, $p3 = null)   X-Ref
This method adds a new criterion to the list of criterias.
If a criterion for the requested column already exists, it is
"OR"ed to the existing criterion.

Any comparison can be used.

Supports a number of different signatures:

addOr(column, value, comparison)
<code>
$crit = $orig_crit->addOr(&quot;column&quot;,
&quot;value&quot;
&quot;Criterion::GREATER_THAN&quot;);
</code>

addOr(column, value)
<code>
$crit = $orig_crit->addOr(&quot;column&quot;, &quot;value&quot;);
</code>

addOr(Criterion)

return: Criteria A modified Criteria object.

Classe: CriterionIterator  - X-Ref

Class that implements SPL Iterator interface.  This allows foreach() to
be used w/ Criteria objects.  Probably there is no performance advantage
to doing it this way, but it makes sense -- and simpler code.

__construct($criteria)   X-Ref
Pas de description

rewind()   X-Ref
Pas de description

valid()   X-Ref
Pas de description

key()   X-Ref
Pas de description

current()   X-Ref
Pas de description

next()   X-Ref
Pas de description

Classe: Criterion  - X-Ref

This is an "inner" class that describes an object in the criteria.

In Torque this is an inner class of the Criteria class.

__construct(Criteria $outer, $column, $value, $comparison = null)   X-Ref
Create a new instance.

param: Criteria $parent The outer class (this is an "inner" class).
param: string $column TABLE.COLUMN format.
param: mixed $value
param: string $comparison

init(Criteria $criteria)   X-Ref
Init some properties with the help of outer class

param: Criteria $criteria The outer class

getColumn()   X-Ref
Get the column name.

return: string A String with the column name.

setTable($name)   X-Ref
Set the table name.

param: name A String with the table name.
return: void

getTable()   X-Ref
Get the table name.

return: string A String with the table name.

getComparison()   X-Ref
Get the comparison.

return: string A String with the comparison.

getValue()   X-Ref
Get the value.

return: mixed An Object with the value.

getDB()   X-Ref
Get the value of db.
The DBAdapter which might be used to get db specific
variations of sql.

return: DBAdapter value of db.

setDB(DBAdapter $v)   X-Ref
Set the value of db.
The DBAdapter might be used to get db specific variations of sql.

param: DBAdapter $v Value to assign to db.
return: void

setIgnoreCase($b)   X-Ref
Sets ignore case.

param: boolean $b True if case should be ignored.
return: Criterion A modified Criterion object.

isIgnoreCase()   X-Ref
Is ignore case on or off?

return: boolean True if case is ignored.

getClauses()   X-Ref
Get the list of clauses in this Criterion.

return: array

getConjunctions()   X-Ref
Get the list of conjunctions in this Criterion

return: array

addAnd(Criterion $criterion)   X-Ref
Append an AND Criterion onto this Criterion's list.


addOr(Criterion $criterion)   X-Ref
Append an OR Criterion onto this Criterion's list.

return: Criterion

appendPsTo(&$sb, &$params)   X-Ref
Appends a Prepared Statement representation of the Criterion
onto the buffer.

param: string &$sb The stringbuffer that will receive the Prepared Statement
param: array $params A list to which Prepared Statement parameters
return: void

equals($obj)   X-Ref
This method checks another Criteria to see if they contain
the same attributes and hashtable entries.

return: boolean

hashCode()   X-Ref
Returns a hash code value for the object.


getAllTables()   X-Ref
Get all tables from nested criterion objects

return: array

addCriterionTable(Criterion $c, &$s)   X-Ref
method supporting recursion through all criterions to give
us a string array of tables from each criterion

return: void

getAttachedCriterion()   X-Ref
get an array of all criterion attached to this
recursing through all sub criterion

return: array Criterion[]

traverseCriterion(Criterion $c, &$a)   X-Ref
method supporting recursion through all criterions to give
us an array of them

param: Criterion $c
param: array &$a
return: void

Classe: Join  - X-Ref

Data object to describe a join between two tables, for example
<pre>
table_a LEFT JOIN table_b ON table_a.id = table_b.a_id
</pre>

__construct($leftColumn, $rightColumn, $joinType = null)   X-Ref
Constructor

param: leftColumn the left column of the join condition;
param: rightColumn the right column of the join condition
param: joinType the type of the join. Valid join types are

getJoinType()   X-Ref

return: the type of the join, i.e. Criteria::LEFT_JOIN(), ...,

getLeftColumn()   X-Ref

return: the left column of the join condition

getLeftColumnName()   X-Ref
Pas de description

getLeftTableName()   X-Ref
Pas de description

getRightColumn()   X-Ref

return: the right column of the join condition

getRightColumnName()   X-Ref
Pas de description

getRightTableName()   X-Ref
Pas de description

toString()   X-Ref
returns a String representation of the class,
mainly for debugging purposes

return: a String representation of the class



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7