Doctrine_Query > Doctrine_Query_Abstract > Doctrine_Hydrate
| Returns | Name | Description |
|---|---|---|
| addPendingJoinCondition | ||
| adjustProcessedParam | Adjust the processed param index for "foo.bar IN ?" support | |
| buildAssociativeRelationSql | ||
| buildIndexBy | ||
| string | buildInheritanceJoinSql | |
| buildSimpleRelationSql | ||
| string | buildSqlQuery | Build the SQL query from the DQL |
| clear | Clears all the sql parts. | |
| boolean | contains | Method to check if a arbitrary piece of dql exists |
| copy | Copies a Doctrine_Query object. | |
| integer | count | Fetches the count of the query. This method executes the main query without all the selected fields, ORDER BY part, LIMIT part and OFFSET part. Example: Main query: SELECT u.*, p.phonenumber FROM User u LEFT JOIN u.Phonenumber p WHERE p.phonenumber = '12 |
| create | create returns a new Doctrine_Query object | |
| Doctrine_Hydrate | createSubquery | createSubquery creates a subquery |
| array | fetchArray | fetchArray Convenience method to execute using array fetching as hydration mode. |
| mixed | fetchOne | fetchOne Convenience method to execute the query and return the first item of the collection. |
| free | Frees the resources used by the query object. It especially breaks a cyclic reference between the query object and it's parsers. This enables PHP's current GC to reclaim the memory. This method can therefore be used to reduce memory usage when creating a lot of query objects during a request. | |
| string | getCountSqlQuery | Get count sql query for this Doctrine_Query instance. This method is used in Doctrine_Query::count() for returning an integer for the number of records which will be returned when executed. |
| array | getDqlPart | Retrieves a specific DQL query part. |
| string | getExpressionOwner | getExpressionOwner returns the component alias for owner of given expression |
| string | getLimitSubquery | getLimitSubquery this is method is used by the record limit algorithm when fetching one-to-many, many-to-many associated data with LIMIT clause an additional subquery is needed for limiting the number of returned records instead of limiting the number of sql result set rows |
| string | getSqlAggregateAlias | |
| string | getSqlQuery | builds the sql query from the given parameters and applies things such as column aggregation inheritance and limit subqueries if needed |
| isSubquery | if $bool parameter is set this method sets the value of Doctrine_Query::$isSubquery. If this value is set to true the query object will not load the primary key fields of the selected components. If null is given as the first parameter this method retr | |
| load | ||
| loadRoot | ||
| string | parseClause |
parseClause parses given DQL clause this method handles five tasks:
Converts all DQL functions to their native SQL equivalents Converts all component references to their table alias equivalents Converts all field names to actual column |
| parseDqlQuery | DQL PARSER parses a DQL query first splits the query in parts and then uses individual parsers for each part | |
| parseFunctionExpression | ||
| parseIdentifierReference | ||
| parseSelect | parseSelect parses the query select part and adds selected fields to pendingFields array | |
| string | parseSelectField |
Parses a nested field |
| parseSubquery | ||
| processPendingAggregates | processPendingAggregates processes pending aggregate values for given component alias | |
| string | processPendingFields | the fields in SELECT clause cannot be parsed until the components in FROM clause are parsed, hence this method is called everytime a specific component is being parsed. For instance, the wildcard '*' is expanded in the list of columns. |
| processPendingSubqueries | processPendingSubqueries processes pending subqueries subqueries can only be processed when the query is fully constructed since some subqueries may be correlated | |
| mixed | query | Queries the database with DQL (Doctrine Query Language). This methods parses a Dql query and builds the query parts. |
| reset | Resets the query to the state just after it has been instantiated. | |
| string | _buildSqlFromPart | _buildSqlFromPart builds the from part of the query and returns it |
| string | _buildSqlQueryBase | returns the base of the generated sql query On mysql driver special strategy has to be used for DELETE statements (where is this special strategy??) |
| _killReference | Kill the reference for the passed class property. This method simply copies the value to a temporary variable and then unsets the reference and re-assigns the old value but not by reference | |
| Processed | _processPendingJoinConditions | Processes the pending join conditions, used for dynamically add conditions to root component/joined components without interfering in the main dql handling. |
| __clone | Magic method called after cloning process. |
| $componentAlias | component alias |
| $joinCondition | dql join condition |
returns this object
Adjust the processed param index for "foo.bar IN ?" support
| $name | component class name |
| $componentAlias | alias of the component in the dql |
returns query part
Build the SQL query from the DQL
returns The generated SQL string
Clears all the sql parts.
| $dql | Arbitrary piece of dql to check for |
Method to check if a arbitrary piece of dql exists
Copies a Doctrine_Query object.
returns Copy of the Doctrine_Query instance.
| $params | an array of prepared statement parameters |
Fetches the count of the query.
This method executes the main query without all the selected fields, ORDER BY part, LIMIT part and OFFSET part.
Example: Main query: SELECT u.*, p.phonenumber FROM User u LEFT JOIN u.Phonenumber p WHERE p.phonenumber = '12
returns the count of this query
| $conn | optional connection parameter |
| $class | Query class to instantiate |
create returns a new Doctrine_Query object
createSubquery creates a subquery
fetchArray Convenience method to execute using array fetching as hydration mode.
| $params | Query parameters |
| $hydrationMode | Hydration mode: see Doctrine_Core::HYDRATE_* constants |
fetchOne Convenience method to execute the query and return the first item of the collection.
returns Array or Doctrine_Collection, depending on hydration mode. False if no result.
Frees the resources used by the query object. It especially breaks a cyclic reference between the query object and it's parsers. This enables PHP's current GC to reclaim the memory.
This method can therefore be used to reduce memory usage when creating a lot of query objects during a request.
returns this object
Get count sql query for this Doctrine_Query instance.
This method is used in Doctrine_Query::count() for returning an integer for the number of records which will be returned when executed.
| $queryPart | the name of the query part; can be: array from, containing strings; array select, containg string; boolean forUpdate; array set; array join; array where; array groupby; array having; array orderby, containing s |
Retrieves a specific DQL query part.
| $expr | expression from which to get to owner from |
getExpressionOwner returns the component alias for owner of given expression
returns the component alias
getLimitSubquery this is method is used by the record limit algorithm
when fetching one-to-many, many-to-many associated data with LIMIT clause an additional subquery is needed for limiting the number of returned records instead of limiting the number of sql result set rows
returns the limit subquery
| $dqlAlias | the dql alias of an aggregate value |
| $params | an array of prepared statement params (needed only in mysql driver when limit subquery algorithm is used) |
builds the sql query from the given parameters and applies things such as column aggregation inheritance and limit subqueries if needed
returns the built sql query
| $bool | whether or not this query acts as a subquery |
if $bool parameter is set this method sets the value of Doctrine_Query::$isSubquery. If this value is set to true the query object will not load the primary key fields of the selected components.
If null is given as the first parameter this method retr
| $path | component alias |
parseClause parses given DQL clause
this method handles five tasks:
Converts all DQL functions to their native SQL equivalents
Converts all component references to their table alias equivalents
Converts all field names to actual column
returns SQL string
| $query | DQL query |
| $clear | whether or not to clear the aliases |
DQL PARSER
parses a DQL query first splits the query in parts and then uses individual parsers for each part
throws Doctrine_Query_Exception if some generic parsing error occurs
parseSelect parses the query select part and adds selected fields to pendingFields array
Parses a nested field
parseSelectField('u.Phonenumber.value');]]>
returns SQL fragment
throws Doctrine_Query_Exception if unknown component alias has been given
processPendingAggregates processes pending aggregate values for given component alias
| $componentAlias | the alias of the component |
the fields in SELECT clause cannot be parsed until the components in FROM clause are parsed, hence this method is called everytime a specific component is being parsed. For instance, the wildcard '*' is expanded in the list of columns.
returns SQL code
throws Doctrine_Query_Exception if unknown component alias has been given
processPendingSubqueries processes pending subqueries
subqueries can only be processed when the query is fully constructed since some subqueries may be correlated
| $query | Dql query |
| $params | prepared statement parameters |
| $hydrationMode | Doctrine_Core::HYDRATE_ARRAY or Doctrine_Core::HYDRATE_RECORD |
Queries the database with DQL (Doctrine Query Language).
This methods parses a Dql query and builds the query parts.
Resets the query to the state just after it has been instantiated.
_buildSqlFromPart builds the from part of the query and returns it
returns the query sql from part
returns the base of the generated sql query On mysql driver special strategy has to be used for DELETE statements (where is this special strategy??)
returns the base of the generated sql query
Kill the reference for the passed class property.
This method simply copies the value to a temporary variable and then unsets the reference and re-assigns the old value but not by reference
| $alias | Component Alias |
Processes the pending join conditions, used for dynamically add conditions to root component/joined components without interfering in the main dql handling.
returns pending conditions
Magic method called after cloning process.