Zend_Db_SelectClass for SQL SELECT generation and results.
Located in /Db/Select.php (line 44)
| Class | Description |
|---|---|
Zend_Db_Table_Select
|
Class for SQL SELECT query manipulation for the Zend_Db_Table component. |
Zend_Db_Select
from
(array|string|Zend_Db_Expr $name, [array|string|Zend_Db_Expr $cols = '*'], [string $schema = null])
Zend_Db_Select
join
(array|string|Zend_Db_Expr $name, string $cond, [array|string $cols = self::SQL_WILDCARD], [string $schema = null])
Zend_Db_Select
joinCross
(array|string|Zend_Db_Expr $name, [array|string $cols = self::SQL_WILDCARD], [string $schema = null])
Zend_Db_Select
joinFull
(array|string|Zend_Db_Expr $name, string $cond, [array|string $cols = self::SQL_WILDCARD], [string $schema = null])
Zend_Db_Select
joinInner
(array|string|Zend_Db_Expr $name, string $cond, [array|string $cols = self::SQL_WILDCARD], [string $schema = null])
Zend_Db_Select
joinLeft
(array|string|Zend_Db_Expr $name, string $cond, [array|string $cols = self::SQL_WILDCARD], [string $schema = null])
Zend_Db_Select
joinNatural
(array|string|Zend_Db_Expr $name, [array|string $cols = self::SQL_WILDCARD], [string $schema = null])
Zend_Db_Select
joinRight
(array|string|Zend_Db_Expr $name, string $cond, [array|string $cols = self::SQL_WILDCARD], [string $schema = null])
Zend_Db_Select
_join
(null|string $type, array|string|Zend_Db_Expr $name, string $cond, array|string $cols, [string $schema = null])
void
_tableCols
( $correlationName, array|string $cols, [bool|string $afterCorrelationName = null], string $tbl)
string
_where
(string $condition, [mixed $value = null], [string $type = null], [boolean $bool = true])
static array
$_joinTypes
= array(Specify legal join types.
static array
$_partsInit
= array(The initial values for the $_parts array.
NOTE: It is important for the 'FOR_UPDATE' part to be last to ensure meximum compatibility with database adapters.
static array
$_unionTypes
= array(Specify legal union types.
Zend_Db_Adapter_Abstract
$_adapter
(line 96)
Zend_Db_Adapter_Abstract object.
array
$_bind
= array() (line 89)
Bind variables for query
array
$_parts
= array() (line 149)
The component parts of a SELECT statement.
Initialized to the $_partsInit array in the constructor.
array
$_tableCols
= array() (line 156)
Tracks which columns are being select from each table and join.
assemble (line 699)
Converts this object to an SQL SELECT string.
columns (line 243)
Specifies the columns used in the FROM clause.
The parameter can be a single string or Zend_Db_Expr object, or else an array of strings or Zend_Db_Expr objects.
distinct (line 198)
Makes the query SELECT DISTINCT.
forUpdate (line 650)
Makes the query SELECT FOR UPDATE.
from (line 228)
Adds a FROM table and optional columns to the query.
The first parameter $name can be a simple string, in which case the correlation name is generated automatically. If you want to specify the correlation name, the first parameter must be an associative array in which the key is the physical table name, and the value is the correlation name. For example, array('table' => 'alias'). The correlation name is prepended to all columns fetched for this table.
The second parameter can be a single string or Zend_Db_Expr object, or else an array of strings or Zend_Db_Expr objects.
The first parameter can be null or an empty string, in which case no correlation name is generated or prepended to the columns named in the second parameter.
getAdapter (line 733)
Gets the Zend_Db_Adapter_Abstract for this particular Zend_Db_Select object.
getBind (line 174)
Get bind variables
getPart (line 663)
Get part of the structured information for the currect query.
group (line 505)
Adds grouping to the query.
having (line 532)
Adds a HAVING condition to the query by AND.
If a value is passed as the second param, it will be quoted and replaced into the condition wherever a question-mark appears. See where() for an example
join (line 313)
Adds a JOIN table and columns to the query.
The $name and $cols parameters follow the same logic as described in the from() method.
joinCross (line 416)
Add a CROSS JOIN table and colums to the query.
A cross join is a cartesian product; there is no join condition.
The $name and $cols parameters follow the same logic as described in the from() method.
joinFull (line 399)
Add a FULL OUTER JOIN table and colums to the query.
A full outer join is like combining a left outer join and a right outer join. All rows from both tables are included, paired with each other on the same row of the result set if they satisfy the join condition, and otherwise paired with NULLs in place of columns from the other table.
The $name and $cols parameters follow the same logic as described in the from() method.
joinInner (line 334)
Add an INNER JOIN table and colums to the query
Rows in both tables are matched according to the expression in the $cond argument. The result set is comprised of all cases where rows from the left table match rows from the right table.
The $name and $cols parameters follow the same logic as described in the from() method.
joinLeft (line 355)
Add a LEFT OUTER JOIN table and colums to the query
All rows from the left operand table are included, matching rows from the right operand table included, and the columns from the right operand table are filled with NULLs if no row exists matching the left table.
The $name and $cols parameters follow the same logic as described in the from() method.
joinNatural (line 436)
Add a NATURAL JOIN table and colums to the query.
A natural join assumes an equi-join across any column(s) that appear with the same name in both tables. Only natural inner joins are supported by this API, even though SQL permits natural outer joins as well.
The $name and $cols parameters follow the same logic as described in the from() method.
joinRight (line 377)
Add a RIGHT OUTER JOIN table and colums to the query.
Right outer join is the complement of left outer join. All rows from the right operand table are included, matching rows from the left operand table included, and the columns from the left operand table are filled with NULLs if no row exists matching the right table.
The $name and $cols parameters follow the same logic as described in the from() method.
limit (line 621)
Sets a limit count and offset to the query.
limitPage (line 635)
Sets the limit and count by page number.
order (line 581)
Adds a row order to the query.
orHaving (line 559)
Adds a HAVING condition to the query by OR.
Otherwise identical to orHaving().
orWhere (line 492)
Adds a WHERE condition to the query by OR.
Otherwise identical to where().
query (line 680)
Executes the current select object and returns the result
reset (line 717)
Clear parts of the Select object, or an individual part.
Constructor __construct (line 163)
Class constructor
union (line 280)
Adds a UNION clause to the query.
The first parameter has to be an array of Zend_Db_Select or sql query strings.
where (line 473)
Adds a WHERE condition to the query by AND.
If a value is passed as the second param, it will be quoted and replaced into the condition wherever a question-mark appears. Array values are quoted and comma-separated.
Note that it is more correct to use named bindings in your queries for values other than strings. When you use named bindings, don't forget to pass the values when actually making a query:
_getDummyTable (line 1018)
_getQuotedSchema (line 1029)
Return a quoted schema name
_getQuotedTable (line 1044)
Return a quoted table name
_join (line 754)
Populate the $_parts 'join' key
Does the dirty work of populating the join key.
The $name and $cols parameters follow the same logic as described in the from() method.
_joinUsing (line 873)
Handle JOIN... USING... syntax
This is functionality identical to the existing JOIN methods, however the join condition can be passed as a single column name. This method then completes the ON condition by using the same field for the FROM table and the JOIN table.
These joins are called by the developer simply by adding 'Using' to the method name. E.g. * joinUsing * joinInnerUsing * joinFullUsing * joinRightUsing * joinLeftUsing
_renderColumns (line 1070)
Render DISTINCT clause
_renderDistinct (line 1055)
Render DISTINCT clause
_renderForupdate (line 1284)
Render FOR UPDATE clause
_renderFrom (line 1103)
Render FROM clause
_renderGroup (line 1191)
Render GROUP clause
_renderHaving (line 1210)
Render HAVING clause
_renderLimitoffset (line 1254)
Render LIMIT OFFSET clause
_renderOrder (line 1225)
Render ORDER clause
_renderUnion (line 1151)
Render UNION query
_renderWhere (line 1176)
Render WHERE clause
_tableCols (line 920)
Adds to the internal table-to-column mapping array.
_where (line 992)
Internal function for creating the where clause
__call (line 1302)
Turn magic function calls into non-magic function calls for joinUsing syntax
__toString (line 1340)
Implements magic method.
COLUMNS
= 'columns'
(line 48)
CROSS_JOIN
= 'cross join'
(line 63)
DISTINCT
= 'distinct'
(line 47)
FOR_UPDATE
= 'forupdate'
(line 57)
FROM
= 'from'
(line 49)
FULL_JOIN
= 'full join'
(line 62)
GROUP
= 'group'
(line 52)
HAVING
= 'having'
(line 53)
INNER_JOIN
= 'inner join'
(line 59)
LEFT_JOIN
= 'left join'
(line 60)
LIMIT_COUNT
= 'limitcount'
(line 55)
LIMIT_OFFSET
= 'limitoffset'
(line 56)
NATURAL_JOIN
= 'natural join'
(line 64)
ORDER
= 'order'
(line 54)
RIGHT_JOIN
= 'right join'
(line 61)
SQL_AND
= 'AND'
(line 77)
SQL_AS
= 'AS'
(line 78)
SQL_ASC
= 'ASC'
(line 81)
SQL_DESC
= 'DESC'
(line 82)
SQL_DISTINCT
= 'DISTINCT'
(line 72)
SQL_FOR_UPDATE
= 'FOR UPDATE'
(line 76)
SQL_FROM
= 'FROM'
(line 70)
SQL_GROUP_BY
= 'GROUP BY'
(line 73)
SQL_HAVING
= 'HAVING'
(line 75)
SQL_ON
= 'ON'
(line 80)
SQL_OR
= 'OR'
(line 79)
SQL_ORDER_BY
= 'ORDER BY'
(line 74)
SQL_SELECT
= 'SELECT'
(line 67)
SQL_UNION
= 'UNION'
(line 68)
SQL_UNION_ALL
= 'UNION ALL'
(line 69)
SQL_WHERE
= 'WHERE'
(line 71)
SQL_WILDCARD
= '*'
(line 66)
UNION
= 'union'
(line 50)
WHERE
= 'where'
(line 51)
Documentation generated on Mon, 21 Jun 2010 15:43:54 -0400 by phpDocumentor 1.4.3