From ba167898434880c938682cc8a5ea853a585fd127 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Thu, 13 Dec 2012 16:36:14 +0000 Subject: [PATCH] Fixed documentation for Doctrine\ORM\Query --- lib/Doctrine/ORM/Query/Expr.php | 126 +++-- lib/Doctrine/ORM/Query/FilterCollection.php | 13 +- lib/Doctrine/ORM/Query/Lexer.php | 2 +- lib/Doctrine/ORM/Query/Parameter.php | 34 +- .../ORM/Query/ParameterTypeInferer.php | 7 +- lib/Doctrine/ORM/Query/Parser.php | 104 +++- lib/Doctrine/ORM/Query/ParserResult.php | 13 +- lib/Doctrine/ORM/Query/Printer.php | 10 +- lib/Doctrine/ORM/Query/QueryException.php | 100 +++- .../ORM/Query/QueryExpressionVisitor.php | 23 +- lib/Doctrine/ORM/Query/ResultSetMapping.php | 146 ++++-- .../ORM/Query/ResultSetMappingBuilder.php | 92 ++-- lib/Doctrine/ORM/Query/SqlWalker.php | 315 ++++-------- lib/Doctrine/ORM/Query/TreeWalker.php | 181 ++++--- lib/Doctrine/ORM/Query/TreeWalkerAdapter.php | 452 ++++++++---------- lib/Doctrine/ORM/Query/TreeWalkerChain.php | 271 +++-------- 16 files changed, 986 insertions(+), 903 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Expr.php b/lib/Doctrine/ORM/Query/Expr.php index db461f9fd..90c706137 100644 --- a/lib/Doctrine/ORM/Query/Expr.php +++ b/lib/Doctrine/ORM/Query/Expr.php @@ -20,9 +20,8 @@ namespace Doctrine\ORM\Query; /** - * This class is used to generate DQL expressions via a set of PHP static functions - * - * + * This class is used to generate DQL expressions via a set of PHP static functions. + * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -43,9 +42,10 @@ class Expr * $expr->andX($expr->eq('u.type', ':1'), $expr->eq('u.role', ':2')); * * @param \Doctrine\ORM\Query\Expr\Comparison | - * \Doctrine\ORM\Query\Expr\Func | - * \Doctrine\ORM\Query\Expr\Orx - * $x Optional clause. Defaults = null, but requires at least one defined when converting to string. + * \Doctrine\ORM\Query\Expr\Func | + * \Doctrine\ORM\Query\Expr\Orx + * $x Optional clause. Defaults to null, but requires at least one defined when converting to string. + * * @return Expr\Andx */ public function andX($x = null) @@ -62,8 +62,9 @@ class Expr * // (u.type = ?1) OR (u.role = ?2) * $q->where($q->expr()->orX('u.type = ?1', 'u.role = ?2')); * - * @param mixed $x Optional clause. Defaults = null, but requires + * @param mixed $x Optional clause. Defaults to null, but requires * at least one defined when converting to string. + * * @return Expr\Orx */ public function orX($x = null) @@ -74,7 +75,8 @@ class Expr /** * Creates an ASCending order expression. * - * @param $sort + * @param mixed $expr + * * @return Expr\OrderBy */ public function asc($expr) @@ -85,7 +87,8 @@ class Expr /** * Creates a DESCending order expression. * - * @param $sort + * @param mixed $expr + * * @return Expr\OrderBy */ public function desc($expr) @@ -103,8 +106,9 @@ class Expr * // u.id = ?1 * $expr->eq('u.id', '?1'); * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Comparison */ public function eq($x, $y) @@ -121,8 +125,9 @@ class Expr * // u.id <> ?1 * $q->where($q->expr()->neq('u.id', '?1')); * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Comparison */ public function neq($x, $y) @@ -139,8 +144,9 @@ class Expr * // u.id < ?1 * $q->where($q->expr()->lt('u.id', '?1')); * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Comparison */ public function lt($x, $y) @@ -157,8 +163,9 @@ class Expr * // u.id <= ?1 * $q->where($q->expr()->lte('u.id', '?1')); * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Comparison */ public function lte($x, $y) @@ -175,8 +182,9 @@ class Expr * // u.id > ?1 * $q->where($q->expr()->gt('u.id', '?1')); * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Comparison */ public function gt($x, $y) @@ -193,8 +201,9 @@ class Expr * // u.id >= ?1 * $q->where($q->expr()->gte('u.id', '?1')); * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Comparison */ public function gte($x, $y) @@ -206,6 +215,7 @@ class Expr * Creates an instance of AVG() function, with the given argument. * * @param mixed $x Argument to be used in AVG() function. + * * @return Expr\Func */ public function avg($x) @@ -217,6 +227,7 @@ class Expr * Creates an instance of MAX() function, with the given argument. * * @param mixed $x Argument to be used in MAX() function. + * * @return Expr\Func */ public function max($x) @@ -228,6 +239,7 @@ class Expr * Creates an instance of MIN() function, with the given argument. * * @param mixed $x Argument to be used in MIN() function. + * * @return Expr\Func */ public function min($x) @@ -239,6 +251,7 @@ class Expr * Creates an instance of COUNT() function, with the given argument. * * @param mixed $x Argument to be used in COUNT() function. + * * @return Expr\Func */ public function count($x) @@ -250,6 +263,7 @@ class Expr * Creates an instance of COUNT(DISTINCT) function, with the given argument. * * @param mixed $x Argument to be used in COUNT(DISTINCT) function. + * * @return string */ public function countDistinct($x) @@ -261,6 +275,7 @@ class Expr * Creates an instance of EXISTS() function, with the given DQL Subquery. * * @param mixed $subquery DQL Subquery to be used in EXISTS() function. + * * @return Expr\Func */ public function exists($subquery) @@ -272,6 +287,7 @@ class Expr * Creates an instance of ALL() function, with the given DQL Subquery. * * @param mixed $subquery DQL Subquery to be used in ALL() function. + * * @return Expr\Func */ public function all($subquery) @@ -283,6 +299,7 @@ class Expr * Creates a SOME() function expression with the given DQL subquery. * * @param mixed $subquery DQL Subquery to be used in SOME() function. + * * @return Expr\Func */ public function some($subquery) @@ -294,6 +311,7 @@ class Expr * Creates an ANY() function expression with the given DQL subquery. * * @param mixed $subquery DQL Subquery to be used in ANY() function. + * * @return Expr\Func */ public function any($subquery) @@ -305,6 +323,7 @@ class Expr * Creates a negation expression of the given restriction. * * @param mixed $restriction Restriction to be used in NOT() function. + * * @return Expr\Func */ public function not($restriction) @@ -316,6 +335,7 @@ class Expr * Creates an ABS() function expression with the given argument. * * @param mixed $x Argument to be used in ABS() function. + * * @return Expr\Func */ public function abs($x) @@ -333,8 +353,9 @@ class Expr * // u.salary * u.percentAnualSalaryIncrease * $q->expr()->prod('u.salary', 'u.percentAnualSalaryIncrease') * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Math */ public function prod($x, $y) @@ -351,8 +372,9 @@ class Expr * // u.monthlySubscriptionCount - 1 * $q->expr()->diff('u.monthlySubscriptionCount', '1') * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Math */ public function diff($x, $y) @@ -369,8 +391,9 @@ class Expr * // u.numChildren + 1 * $q->expr()->diff('u.numChildren', '1') * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Math */ public function sum($x, $y) @@ -387,8 +410,9 @@ class Expr * // u.total / u.period * $expr->quot('u.total', 'u.period') * - * @param mixed $x Left expression - * @param mixed $y Right expression + * @param mixed $x Left expression. + * @param mixed $y Right expression. + * * @return Expr\Math */ public function quot($x, $y) @@ -400,6 +424,7 @@ class Expr * Creates a SQRT() function expression with the given argument. * * @param mixed $x Argument to be used in SQRT() function. + * * @return Expr\Func */ public function sqrt($x) @@ -410,8 +435,9 @@ class Expr /** * Creates an IN() expression with the given arguments. * - * @param string $x Field in string format to be restricted by IN() function - * @param mixed $y Argument to be used in IN() function. + * @param string $x Field in string format to be restricted by IN() function. + * @param mixed $y Argument to be used in IN() function. + * * @return Expr\Func */ public function in($x, $y) @@ -429,8 +455,9 @@ class Expr /** * Creates a NOT IN() expression with the given arguments. * - * @param string $x Field in string format to be restricted by NOT IN() function + * @param string $x Field in string format to be restricted by NOT IN() function. * @param mixed $y Argument to be used in NOT IN() function. + * * @return Expr\Func */ public function notIn($x, $y) @@ -448,7 +475,8 @@ class Expr /** * Creates an IS NULL expression with the given arguments. * - * @param string $x Field in string format to be restricted by IS NULL + * @param string $x Field in string format to be restricted by IS NULL. + * * @return string */ public function isNull($x) @@ -459,7 +487,8 @@ class Expr /** * Creates an IS NOT NULL expression with the given arguments. * - * @param string $x Field in string format to be restricted by IS NOT NULL + * @param string $x Field in string format to be restricted by IS NOT NULL. + * * @return string */ public function isNotNull($x) @@ -471,7 +500,8 @@ class Expr * Creates a LIKE() comparison expression with the given arguments. * * @param string $x Field in string format to be inspected by LIKE() comparison. - * @param mixed $y Argument to be used in LIKE() comparison. + * @param mixed $y Argument to be used in LIKE() comparison. + * * @return Expr\Comparison */ public function like($x, $y) @@ -483,7 +513,8 @@ class Expr * Creates a NOT LIKE() comparison expression with the given arguments. * * @param string $x Field in string format to be inspected by LIKE() comparison. - * @param mixed $y Argument to be used in LIKE() comparison. + * @param mixed $y Argument to be used in LIKE() comparison. + * * @return Expr\Comparison */ public function notLike($x, $y) @@ -495,7 +526,8 @@ class Expr * Creates a CONCAT() function expression with the given arguments. * * @param mixed $x First argument to be used in CONCAT() function. - * @param mixed $x Second argument to be used in CONCAT() function. + * @param mixed $y Second argument to be used in CONCAT() function. + * * @return Expr\Func */ public function concat($x, $y) @@ -506,9 +538,10 @@ class Expr /** * Creates a SUBSTRING() function expression with the given arguments. * - * @param mixed $x Argument to be used as string to be cropped by SUBSTRING() function. - * @param integer $from Initial offset to start cropping string. May accept negative values. - * @param integer $len Length of crop. May accept negative values. + * @param mixed $x Argument to be used as string to be cropped by SUBSTRING() function. + * @param int $from Initial offset to start cropping string. May accept negative values. + * @param int|null $len Length of crop. May accept negative values. + * * @return Expr\Func */ public function substring($x, $from, $len = null) @@ -524,6 +557,7 @@ class Expr * Creates a LOWER() function expression with the given argument. * * @param mixed $x Argument to be used in LOWER() function. + * * @return Expr\Func A LOWER function expression. */ public function lower($x) @@ -535,6 +569,7 @@ class Expr * Creates an UPPER() function expression with the given argument. * * @param mixed $x Argument to be used in UPPER() function. + * * @return Expr\Func An UPPER function expression. */ public function upper($x) @@ -546,6 +581,7 @@ class Expr * Creates a LENGTH() function expression with the given argument. * * @param mixed $x Argument to be used as argument of LENGTH() function. + * * @return Expr\Func A LENGTH function expression. */ public function length($x) @@ -557,6 +593,7 @@ class Expr * Creates a literal expression of the given argument. * * @param mixed $literal Argument to be converted to literal. + * * @return Expr\Literal */ public function literal($literal) @@ -568,6 +605,7 @@ class Expr * Quotes a literal value, if necessary, according to the DQL syntax. * * @param mixed $literal The literal value. + * * @return string */ private function _quoteLiteral($literal) @@ -584,9 +622,10 @@ class Expr /** * Creates an instance of BETWEEN() function, with the given argument. * - * @param mixed $val Valued to be inspected by range values. - * @param integer $x Starting range value to be used in BETWEEN() function. - * @param integer $y End point value to be used in BETWEEN() function. + * @param mixed $val Valued to be inspected by range values. + * @param integer $x Starting range value to be used in BETWEEN() function. + * @param integer $y End point value to be used in BETWEEN() function. + * * @return Expr\Func A BETWEEN expression. */ public function between($val, $x, $y) @@ -598,6 +637,7 @@ class Expr * Creates an instance of TRIM() function, with the given argument. * * @param mixed $x Argument to be used as argument of TRIM() function. + * * @return Expr\Func a TRIM expression. */ public function trim($x) diff --git a/lib/Doctrine/ORM/Query/FilterCollection.php b/lib/Doctrine/ORM/Query/FilterCollection.php index 66337af6a..61647ba33 100644 --- a/lib/Doctrine/ORM/Query/FilterCollection.php +++ b/lib/Doctrine/ORM/Query/FilterCollection.php @@ -30,6 +30,7 @@ use Doctrine\ORM\EntityManager; class FilterCollection { /* Filter STATES */ + /** * A filter object is in CLEAN state when it has no changed parameters. */ @@ -67,7 +68,7 @@ class FilterCollection private $filterHash; /** - * @var integer $state The current state of this filter + * @var integer The current state of this filter. */ private $filtersState = self::FILTERS_STATE_CLEAN; @@ -83,7 +84,7 @@ class FilterCollection } /** - * Get all the enabled filters. + * Gets all the enabled filters. * * @return array The enabled filters. */ @@ -97,9 +98,9 @@ class FilterCollection * * @param string $name Name of the filter. * - * @throws \InvalidArgumentException If the filter does not exist. - * * @return \Doctrine\ORM\Query\Filter\SQLFilter The enabled filter. + * + * @throws \InvalidArgumentException If the filter does not exist. */ public function enable($name) { @@ -145,7 +146,7 @@ class FilterCollection } /** - * Get an enabled filter from the collection. + * Gets an enabled filter from the collection. * * @param string $name Name of the filter. * @@ -191,7 +192,7 @@ class FilterCollection } /** - * Set the filter state to dirty. + * Sets the filter state to dirty. */ public function setFiltersStateDirty() { diff --git a/lib/Doctrine/ORM/Query/Lexer.php b/lib/Doctrine/ORM/Query/Lexer.php index 4692b6ae8..bf0b5f6db 100644 --- a/lib/Doctrine/ORM/Query/Lexer.php +++ b/lib/Doctrine/ORM/Query/Lexer.php @@ -113,7 +113,7 @@ class Lexer extends \Doctrine\Common\Lexer /** * Creates a new query scanner object. * - * @param string $input a query string + * @param string $input A query string. */ public function __construct($input) { diff --git a/lib/Doctrine/ORM/Query/Parameter.php b/lib/Doctrine/ORM/Query/Parameter.php index 57813cb63..39e2a7a4f 100644 --- a/lib/Doctrine/ORM/Query/Parameter.php +++ b/lib/Doctrine/ORM/Query/Parameter.php @@ -20,7 +20,7 @@ namespace Doctrine\ORM\Query; /** - * Define a Query Parameter + * Defines a Query Parameter. * * @link www.doctrine-project.org * @since 2.3 @@ -29,36 +29,42 @@ namespace Doctrine\ORM\Query; class Parameter { /** - * @var string Parameter name + * The parameter name. + * + * @var string */ private $name; /** - * @var mixed Parameter value + * The parameter value. + * + * @var mixed */ private $value; /** - * @var mixed Parameter type + * The parameter type. + * + * @var mixed */ private $type; /** * Constructor. * - * @param string $name Parameter name - * @param mixed $value Parameter value - * @param mixed $type Parameter type + * @param string $name Parameter name + * @param mixed $value Parameter value + * @param mixed $type Parameter type */ public function __construct($name, $value, $type = null) { - $this->name = trim($name, ':'); + $this->name = trim($name, ':'); $this->setValue($value, $type); } /** - * Retrieve the Parameter name. + * Retrieves the Parameter name. * * @return string */ @@ -68,7 +74,7 @@ class Parameter } /** - * Retrieve the Parameter value. + * Retrieves the Parameter value. * * @return mixed */ @@ -78,7 +84,7 @@ class Parameter } /** - * Retrieve the Parameter type. + * Retrieves the Parameter type. * * @return mixed */ @@ -88,10 +94,10 @@ class Parameter } /** - * Define the Parameter value. + * Defines the Parameter value. * - * @param mixed $value Parameter value - * @param mixed $type Parameter type + * @param mixed $value Parameter value. + * @param mixed $type Parameter type. */ public function setValue($value, $type = null) { diff --git a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php index 0c4df55ee..602dde6d8 100644 --- a/lib/Doctrine/ORM/Query/ParameterTypeInferer.php +++ b/lib/Doctrine/ORM/Query/ParameterTypeInferer.php @@ -25,7 +25,6 @@ use Doctrine\DBAL\Types\Type; /** * Provides an enclosed support for parameter infering. * - * * @link www.doctrine-project.org * @since 2.0 * @author Benjamin Eberlei @@ -36,13 +35,13 @@ use Doctrine\DBAL\Types\Type; class ParameterTypeInferer { /** - * Infer type of a given value, returning a compatible constant: + * Infers type of a given value, returning a compatible constant: * - Type (\Doctrine\DBAL\Types\Type::*) * - Connection (\Doctrine\DBAL\Connection::PARAM_*) * - * @param mixed $value Parameter value + * @param mixed $value Parameter value. * - * @return mixed Parameter type constant + * @return mixed Parameter type constant. */ public static function inferType($value) { diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index bdf179d0f..f896ccd3a 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -35,7 +35,11 @@ use Doctrine\ORM\Mapping\ClassMetadata; */ class Parser { - /** READ-ONLY: Maps BUILT-IN string function names to AST class names. */ + /** + * READ-ONLY: Maps BUILT-IN string function names to AST class names. + * + * @var array + */ private static $_STRING_FUNCTIONS = array( 'concat' => 'Doctrine\ORM\Query\AST\Functions\ConcatFunction', 'substring' => 'Doctrine\ORM\Query\AST\Functions\SubstringFunction', @@ -45,7 +49,11 @@ class Parser 'identity' => 'Doctrine\ORM\Query\AST\Functions\IdentityFunction', ); - /** READ-ONLY: Maps BUILT-IN numeric function names to AST class names. */ + /** + * READ-ONLY: Maps BUILT-IN numeric function names to AST class names. + * + * @var array + */ private static $_NUMERIC_FUNCTIONS = array( 'length' => 'Doctrine\ORM\Query\AST\Functions\LengthFunction', 'locate' => 'Doctrine\ORM\Query\AST\Functions\LocateFunction', @@ -58,7 +66,11 @@ class Parser 'bit_or' => 'Doctrine\ORM\Query\AST\Functions\BitOrFunction', ); - /** READ-ONLY: Maps BUILT-IN datetime function names to AST class names. */ + /** + * READ-ONLY: Maps BUILT-IN datetime function names to AST class names. + * + * @var array + */ private static $_DATETIME_FUNCTIONS = array( 'current_date' => 'Doctrine\ORM\Query\AST\Functions\CurrentDateFunction', 'current_time' => 'Doctrine\ORM\Query\AST\Functions\CurrentTimeFunction', @@ -133,7 +145,7 @@ class Parser private $queryComponents = array(); /** - * Keeps the nesting level of defined ResultVariables + * Keeps the nesting level of defined ResultVariables. * * @var integer */ @@ -159,10 +171,11 @@ class Parser private $identVariableExpressions = array(); /** - * Check if a function is internally defined. Used to prevent overwriting + * Checks if a function is internally defined. Used to prevent overwriting * of built-in functions through user-defined functions. * * @param string $functionName + * * @return bool */ static public function isInternalFunction($functionName) @@ -192,6 +205,8 @@ class Parser * This tree walker will be run last over the AST, after any other walkers. * * @param string $className + * + * @return void */ public function setCustomOutputTreeWalker($className) { @@ -202,6 +217,8 @@ class Parser * Adds a custom tree walker for modifying the AST. * * @param string $className + * + * @return void */ public function addCustomTreeWalker($className) { @@ -239,7 +256,7 @@ class Parser } /** - * Parse and build AST for the given Query. + * Parses and builds AST for the given Query. * * @return \Doctrine\ORM\Query\AST\SelectStatement | * \Doctrine\ORM\Query\AST\UpdateStatement | @@ -284,8 +301,10 @@ class Parser * If they match, updates the lookahead token; otherwise raises a syntax * error. * - * @param int token type + * @param int $token The token type. + * * @return void + * * @throws QueryException If the tokens dont match. */ public function match($token) @@ -301,10 +320,12 @@ class Parser } /** - * Free this parser enabling it to be reused + * Frees this parser, enabling it to be reused. * - * @param boolean $deep Whether to clean peek and reset errors - * @param integer $position Position to reset + * @param boolean $deep Whether to clean peek and reset errors. + * @param integer $position Position to reset. + * + * @return void */ public function free($deep = false, $position = 0) { @@ -372,13 +393,14 @@ class Parser } /** - * Fix order of identification variables. + * Fixes order of identification variables. * * They have to appear in the select clause in the same order as the * declarations (from ... x join ... y join ... z ...) appear in the query * as the hydration process relies on that order for proper operation. * * @param AST\SelectStatement|AST\DeleteStatement|AST\UpdateStatement $AST + * * @return void */ private function fixIdentificationVariableOrder($AST) @@ -404,8 +426,10 @@ class Parser /** * Generates a new syntax error. * - * @param string $expected Expected string. - * @param array $token Got token. + * @param string $expected Expected string. + * @param array|null $token Got token. + * + * @return void * * @throws \Doctrine\ORM\Query\QueryException */ @@ -427,8 +451,10 @@ class Parser /** * Generates a new semantical error. * - * @param string $message Optional message. - * @param array $token Optional token. + * @param string $message Optional message. + * @param array|null $token Optional token. + * + * @return void * * @throws \Doctrine\ORM\Query\QueryException */ @@ -458,9 +484,10 @@ class Parser } /** - * Peek beyond the matched closing parenthesis and return the first token after that one. + * Peeks beyond the matched closing parenthesis and returns the first token after that one. + * + * @param boolean $resetPeek Reset peek after finding the closing parenthesis. * - * @param boolean $resetPeek Reset peek after finding the closing parenthesis * @return array */ private function peekBeyondClosingParenthesis($resetPeek = true) @@ -495,6 +522,8 @@ class Parser /** * Checks if the given token indicates a mathematical operator. * + * @param array $token + * * @return boolean TRUE if the token is a mathematical operator, FALSE otherwise. */ private function isMathOperator($token) @@ -520,6 +549,8 @@ class Parser /** * Checks whether the given token type indicates an aggregate function. * + * @param int $tokenType + * * @return boolean TRUE if the token type is an aggregate function, FALSE otherwise. */ private function isAggregateFunction($tokenType) @@ -577,6 +608,7 @@ class Parser * Validates that the given NewObjectExpression. * * @param \Doctrine\ORM\Query\AST\SelectClause $AST + * * @return void */ private function processDeferredNewObjectExpressions($AST) @@ -697,8 +729,9 @@ class Parser * SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField * CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField * - * @param array $deferredItem * @param mixed $AST + * + * @return void */ private function processDeferredPathExpressions($AST) { @@ -766,6 +799,9 @@ class Parser } } + /** + * @return void + */ private function processRootEntityAliasSelected() { if ( ! count($this->identVariableExpressions)) { @@ -1010,6 +1046,7 @@ class Parser * PathExpression ::= IdentificationVariable "." identifier * * @param integer $expectedTypes + * * @return \Doctrine\ORM\Query\AST\PathExpression */ public function PathExpression($expectedTypes) @@ -1473,6 +1510,8 @@ class Parser * NewValue ::= SimpleArithmeticExpression | "NULL" * * SimpleArithmeticExpression covers all *Primary grammar rules and also SimpleEntityExpression + * + * @return AST\ArithmeticExpression */ public function NewValue() { @@ -1940,7 +1979,7 @@ class Parser /** * GeneralCaseExpression ::= "CASE" WhenClause {WhenClause}* "ELSE" ScalarExpression "END" * - * @return \Doctrine\ORM\Query\AST\GeneralExpression + * @return \Doctrine\ORM\Query\AST\GeneralCaseExpression */ public function GeneralCaseExpression() { @@ -1963,6 +2002,8 @@ class Parser /** * SimpleCaseExpression ::= "CASE" CaseOperand SimpleWhenClause {SimpleWhenClause}* "ELSE" ScalarExpression "END" * CaseOperand ::= StateFieldPathExpression | TypeDiscriminator + * + * @return AST\SimpleCaseExpression */ public function SimpleCaseExpression() { @@ -1986,7 +2027,7 @@ class Parser /** * WhenClause ::= "WHEN" ConditionalExpression "THEN" ScalarExpression * - * @return \Doctrine\ORM\Query\AST\WhenExpression + * @return \Doctrine\ORM\Query\AST\WhenClause */ public function WhenClause() { @@ -2000,7 +2041,7 @@ class Parser /** * SimpleWhenClause ::= "WHEN" ScalarExpression "THEN" ScalarExpression * - * @return \Doctrine\ORM\Query\AST\SimpleWhenExpression + * @return \Doctrine\ORM\Query\AST\SimpleWhenClause */ public function SimpleWhenClause() { @@ -3136,6 +3177,8 @@ class Parser /** * FunctionDeclaration ::= FunctionsReturningStrings | FunctionsReturningNumerics | FunctionsReturningDatetime + * + * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode */ public function FunctionDeclaration() { @@ -3159,7 +3202,9 @@ class Parser } /** - * Helper function for FunctionDeclaration grammar rule + * Helper function for FunctionDeclaration grammar rule. + * + * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode */ private function CustomFunctionDeclaration() { @@ -3192,6 +3237,8 @@ class Parser * "SQRT" "(" SimpleArithmeticExpression ")" | * "MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")" | * "SIZE" "(" CollectionValuedPathExpression ")" + * + * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode */ public function FunctionsReturningNumerics() { @@ -3204,6 +3251,9 @@ class Parser return $function; } + /** + * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode + */ public function CustomFunctionsReturningNumerics() { // getCustomNumericFunction is case-insensitive @@ -3218,6 +3268,8 @@ class Parser /** * FunctionsReturningDateTime ::= "CURRENT_DATE" | "CURRENT_TIME" | "CURRENT_TIMESTAMP" + * + * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode */ public function FunctionsReturningDatetime() { @@ -3230,6 +3282,9 @@ class Parser return $function; } + /** + * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode + */ public function CustomFunctionsReturningDatetime() { // getCustomDatetimeFunction is case-insensitive @@ -3249,6 +3304,8 @@ class Parser * "TRIM" "(" [["LEADING" | "TRAILING" | "BOTH"] [char] "FROM"] StringPrimary ")" | * "LOWER" "(" StringPrimary ")" | * "UPPER" "(" StringPrimary ")" + * + * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode */ public function FunctionsReturningStrings() { @@ -3261,6 +3318,9 @@ class Parser return $function; } + /** + * @return \Doctrine\ORM\Query\AST\Functions\FunctionNode + */ public function CustomFunctionsReturningStrings() { // getCustomStringFunction is case-insensitive diff --git a/lib/Doctrine/ORM/Query/ParserResult.php b/lib/Doctrine/ORM/Query/ParserResult.php index e068622de..dfd7dd2c9 100644 --- a/lib/Doctrine/ORM/Query/ParserResult.php +++ b/lib/Doctrine/ORM/Query/ParserResult.php @@ -65,8 +65,8 @@ class ParserResult /** * Gets the ResultSetMapping for the parsed query. * - * @return ResultSetMapping The result set mapping of the parsed query or NULL - * if the query is not a SELECT query. + * @return ResultSetMapping|null The result set mapping of the parsed query or NULL + * if the query is not a SELECT query. */ public function getResultSetMapping() { @@ -77,6 +77,8 @@ class ParserResult * Sets the ResultSetMapping of the parsed query. * * @param ResultSetMapping $rsm + * + * @return void */ public function setResultSetMapping(ResultSetMapping $rsm) { @@ -87,6 +89,8 @@ class ParserResult * Sets the SQL executor that should be used for this ParserResult. * * @param \Doctrine\ORM\Query\Exec\AbstractSqlExecutor $executor + * + * @return void */ public function setSqlExecutor($executor) { @@ -108,7 +112,9 @@ class ParserResult * several SQL parameter positions. * * @param string|integer $dqlPosition - * @param integer $sqlPosition + * @param integer $sqlPosition + * + * @return void */ public function addParameterMapping($dqlPosition, $sqlPosition) { @@ -129,6 +135,7 @@ class ParserResult * Gets the SQL parameter positions for a DQL parameter name/position. * * @param string|integer $dqlPosition The name or position of the DQL parameter. + * * @return array The positions of the corresponding SQL parameters. */ public function getSqlParameterPositions($dqlPosition) diff --git a/lib/Doctrine/ORM/Query/Printer.php b/lib/Doctrine/ORM/Query/Printer.php index 83640c5d7..ffb457538 100644 --- a/lib/Doctrine/ORM/Query/Printer.php +++ b/lib/Doctrine/ORM/Query/Printer.php @@ -59,7 +59,9 @@ class Printer * * This method is called before executing a production. * - * @param string $name production name + * @param string $name Production name. + * + * @return void */ public function startProduction($name) { @@ -71,6 +73,8 @@ class Printer * Decreases indentation level by one and prints a closing parenthesis. * * This method is called after executing a production. + * + * @return void */ public function endProduction() { @@ -81,7 +85,9 @@ class Printer /** * Prints text indented with spaces depending on current indentation level. * - * @param string $str text + * @param string $str The text. + * + * @return void */ public function println($str) { diff --git a/lib/Doctrine/ORM/Query/QueryException.php b/lib/Doctrine/ORM/Query/QueryException.php index a439991f9..06a622644 100644 --- a/lib/Doctrine/ORM/Query/QueryException.php +++ b/lib/Doctrine/ORM/Query/QueryException.php @@ -19,12 +19,9 @@ namespace Doctrine\ORM\Query; -use Doctrine\ORM\Query\AST\PathExpression; - /** - * Description of QueryException + * Description of QueryException. * - * * @link www.doctrine-project.org * @since 2.0 * @author Guilherme Blanco @@ -34,56 +31,108 @@ use Doctrine\ORM\Query\AST\PathExpression; */ class QueryException extends \Doctrine\ORM\ORMException { + /** + * @param string $dql + * + * @return QueryException + */ public static function dqlError($dql) { return new self($dql); } + /** + * @param string $message + * @param \Exception|null $previous + * + * @return QueryException + */ public static function syntaxError($message, $previous = null) { return new self('[Syntax Error] ' . $message, 0, $previous); } + /** + * @param string $message + * @param \Exception|null $previous + * + * @return QueryException + */ public static function semanticalError($message, $previous = null) { return new self('[Semantical Error] ' . $message, 0, $previous); } + /** + * @return QueryException + */ public static function invalidLockMode() { return new self('Invalid lock mode hint provided.'); } + /** + * @param string $expected + * @param string $received + * + * @return QueryException + */ public static function invalidParameterType($expected, $received) { return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.'); } + /** + * @param string $pos + * + * @return QueryException + */ public static function invalidParameterPosition($pos) { return new self('Invalid parameter position: ' . $pos); } + /** + * @return QueryException + */ public static function invalidParameterNumber() { return new self("Invalid parameter number: number of bound variables does not match number of tokens"); } + /** + * @param string $value + * + * @return QueryException + */ public static function invalidParameterFormat($value) { return new self('Invalid parameter format, '.$value.' given, but : or ? expected.'); } + /** + * @param string $key + * + * @return QueryException + */ public static function unknownParameter($key) { return new self("Invalid parameter: token ".$key." is not defined in the query."); } + /** + * @return QueryException + */ public static function parameterTypeMissmatch() { return new self("DQL Query parameter and type numbers missmatch, but have to be exactly equal."); } + /** + * @param object $pathExpr + * + * @return QueryException + */ public static function invalidPathExpression($pathExpr) { return new self( @@ -91,12 +140,20 @@ class QueryException extends \Doctrine\ORM\ORMException ); } - public static function invalidLiteral($literal) { + /** + * @param string $literal + * + * @return QueryException + */ + public static function invalidLiteral($literal) + { return new self("Invalid literal '$literal'"); } /** * @param array $assoc + * + * @return QueryException */ public static function iterateWithFetchJoinCollectionNotAllowed($assoc) { @@ -106,6 +163,9 @@ class QueryException extends \Doctrine\ORM\ORMException ); } + /** + * @return QueryException + */ public static function partialObjectsAreDangerous() { return new self( @@ -115,6 +175,11 @@ class QueryException extends \Doctrine\ORM\ORMException ); } + /** + * @param array $assoc + * + * @return QueryException + */ public static function overwritingJoinConditionsNotYetSupported($assoc) { return new self( @@ -124,6 +189,9 @@ class QueryException extends \Doctrine\ORM\ORMException ); } + /** + * @return QueryException + */ public static function associationPathInverseSideNotSupported() { return new self( @@ -132,13 +200,22 @@ class QueryException extends \Doctrine\ORM\ORMException ); } - public static function iterateWithFetchJoinNotAllowed($assoc) { + /** + * @param array $assoc + * + * @return QueryException + */ + public static function iterateWithFetchJoinNotAllowed($assoc) + { return new self( "Iterate with fetch join in class " . $assoc['sourceEntity'] . " using association " . $assoc['fieldName'] . " not allowed." ); } + /** + * @return QueryException + */ public static function associationPathCompositeKeyNotSupported() { return new self( @@ -148,12 +225,23 @@ class QueryException extends \Doctrine\ORM\ORMException ); } + /** + * @param string $className + * @param string $rootClass + * + * @return QueryException + */ public static function instanceOfUnrelatedClass($className, $rootClass) { return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . "inheritance hierachy exists between these two classes."); } + /** + * @param string $dqlAlias + * + * @return QueryException + */ public static function invalidQueryComponent($dqlAlias) { return new self( diff --git a/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php b/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php index 6f16a3515..775d70019 100644 --- a/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php +++ b/lib/Doctrine/ORM/Query/QueryExpressionVisitor.php @@ -30,13 +30,16 @@ use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\Query\Parameter; /** - * Convert Collection expressions to Query expressions + * Converts Collection expressions to Query expressions. * * @author Kirill chEbba Chebunin * @since 2.4 */ class QueryExpressionVisitor extends ExpressionVisitor { + /** + * @var array + */ private static $operatorMap = array( Comparison::GT => Expr\Comparison::GT, Comparison::GTE => Expr\Comparison::GTE, @@ -44,11 +47,18 @@ class QueryExpressionVisitor extends ExpressionVisitor Comparison::LTE => Expr\Comparison::LTE ); + /** + * @var Expr + */ private $expr; + + /** + * @var array + */ private $parameters = array(); /** - * Constructor with internal initialization + * Constructor with internal initialization. */ public function __construct() { @@ -56,7 +66,7 @@ class QueryExpressionVisitor extends ExpressionVisitor } /** - * Get bound parameters. + * Gets bound parameters. * Filled after {@link dispach()}. * * @return \Doctrine\Common\Collections\Collection @@ -67,7 +77,9 @@ class QueryExpressionVisitor extends ExpressionVisitor } /** - * Clear parameters + * Clears parameters. + * + * @return void */ public function clearParameters() { @@ -75,7 +87,7 @@ class QueryExpressionVisitor extends ExpressionVisitor } /** - * Convert Criteria expression to Query one based on static map. + * Converts Criteria expression to Query one based on static map. * * @param string $criteriaOperator * @@ -155,7 +167,6 @@ class QueryExpressionVisitor extends ExpressionVisitor throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); } - } /** diff --git a/lib/Doctrine/ORM/Query/ResultSetMapping.php b/lib/Doctrine/ORM/Query/ResultSetMapping.php index 35505bf5c..9dbe9bc63 100644 --- a/lib/Doctrine/ORM/Query/ResultSetMapping.php +++ b/lib/Doctrine/ORM/Query/ResultSetMapping.php @@ -36,102 +36,134 @@ namespace Doctrine\ORM\Query; class ResultSetMapping { /** + * Whether the result is mixed (contains scalar values together with field values). + * * @ignore - * @var boolean Whether the result is mixed (contains scalar values together with field values). + * @var boolean */ public $isMixed = false; /** + * Maps alias names to class names. + * * @ignore - * @var array Maps alias names to class names. + * @var array */ public $aliasMap = array(); /** + * Maps alias names to related association field names. + * * @ignore - * @var array Maps alias names to related association field names. + * @var array */ public $relationMap = array(); /** + * Maps alias names to parent alias names. + * * @ignore - * @var array Maps alias names to parent alias names. + * @var array */ public $parentAliasMap = array(); /** + * Maps column names in the result set to field names for each class. + * * @ignore - * @var array Maps column names in the result set to field names for each class. + * @var array */ public $fieldMappings = array(); /** + * Maps column names in the result set to the alias/field name to use in the mapped result. + * * @ignore - * @var array Maps column names in the result set to the alias/field name to use in the mapped result. + * @var array */ public $scalarMappings = array(); /** + * Maps column names in the result set to the alias/field type to use in the mapped result. + * * @ignore - * @var array Maps column names in the result set to the alias/field type to use in the mapped result. + * @var array */ public $typeMappings = array(); /** + * Maps entities in the result set to the alias name to use in the mapped result. + * * @ignore - * @var array Maps entities in the result set to the alias name to use in the mapped result. + * @var array */ public $entityMappings = array(); /** + * Maps column names of meta columns (foreign keys, discriminator columns, ...) to field names. + * * @ignore - * @var array Maps column names of meta columns (foreign keys, discriminator columns, ...) to field names. + * @var array */ public $metaMappings = array(); /** + * Maps column names in the result set to the alias they belong to. + * * @ignore - * @var array Maps column names in the result set to the alias they belong to. + * @var array */ public $columnOwnerMap = array(); /** + * List of columns in the result set that are used as discriminator columns. + * * @ignore - * @var array List of columns in the result set that are used as discriminator columns. + * @var array */ public $discriminatorColumns = array(); /** + * Maps alias names to field names that should be used for indexing. + * * @ignore - * @var array Maps alias names to field names that should be used for indexing. + * @var array */ public $indexByMap = array(); /** + * Map from column names to class names that declare the field the column is mapped to. + * * @ignore - * @var array Map from column names to class names that declare the field the column is mapped to. + * @var array */ public $declaringClasses = array(); /** - * @var array This is necessary to hydrate derivate foreign keys correctly. + * This is necessary to hydrate derivate foreign keys correctly. + * + * @var array */ public $isIdentifierColumn = array(); /** - * @var array Maps column names in the result set to field names for each new object expression. + * Maps column names in the result set to field names for each new object expression. + * + * @var array */ public $newObjectMappings = array(); /** * Adds an entity result to this ResultSetMapping. * - * @param string $class The class name of the entity. - * @param string $alias The alias for the class. The alias must be unique among all entity - * results or joined entity results within this ResultSetMapping. - * @param string $resultAlias The result alias with which the entity result should be - * placed in the result structure. + * @param string $class The class name of the entity. + * @param string $alias The alias for the class. The alias must be unique among all entity + * results or joined entity results within this ResultSetMapping. + * @param string|null $resultAlias The result alias with which the entity result should be + * placed in the result structure. + * * @return ResultSetMapping This ResultSetMapping instance. + * * @todo Rename: addRootEntity */ public function addEntityResult($class, $alias, $resultAlias = null) @@ -151,10 +183,12 @@ class ResultSetMapping * The discriminator column will be used to determine the concrete class name to * instantiate. * - * @param string $alias The alias of the entity result or joined entity result the discriminator - * column should be used for. + * @param string $alias The alias of the entity result or joined entity result the discriminator + * column should be used for. * @param string $discrColumn The name of the discriminator column in the SQL result set. + * * @return ResultSetMapping This ResultSetMapping instance. + * * @todo Rename: addDiscriminatorColumn */ public function setDiscriminatorColumn($alias, $discrColumn) @@ -168,8 +202,9 @@ class ResultSetMapping /** * Sets a field to use for indexing an entity result or joined entity result. * - * @param string $alias The alias of an entity result or joined entity result. + * @param string $alias The alias of an entity result or joined entity result. * @param string $fieldName The name of the field to use for indexing. + * * @return ResultSetMapping This ResultSetMapping instance. */ public function addIndexBy($alias, $fieldName) @@ -201,9 +236,10 @@ class ResultSetMapping } /** - * Set to index by a scalar result column name + * Sets to index by a scalar result column name. + * + * @param string $resultColumnName * - * @param $resultColumnName * @return ResultSetMapping This ResultSetMapping instance. */ public function addIndexByScalar($resultColumnName) @@ -216,8 +252,9 @@ class ResultSetMapping /** * Sets a column to use for indexing an entity or joined entity result by the given alias name. * - * @param $alias - * @param $resultColumnName + * @param string $alias + * @param string $resultColumnName + * * @return ResultSetMapping This ResultSetMapping instance. */ public function addIndexByColumn($alias, $resultColumnName) @@ -232,7 +269,9 @@ class ResultSetMapping * a field set for indexing. * * @param string $alias + * * @return boolean + * * @todo Rename: isIndexed($alias) */ public function hasIndexBy($alias) @@ -245,7 +284,9 @@ class ResultSetMapping * as part of an entity result or joined entity result. * * @param string $columnName The name of the column in the SQL result set. + * * @return boolean + * * @todo Rename: isField */ public function isFieldResult($columnName) @@ -256,15 +297,17 @@ class ResultSetMapping /** * Adds a field to the result that belongs to an entity or joined entity. * - * @param string $alias The alias of the root entity or joined entity to which the field belongs. - * @param string $columnName The name of the column in the SQL result set. - * @param string $fieldName The name of the field on the declaring class. - * @param string $declaringClass The name of the class that declares/owns the specified field. - * When $alias refers to a superclass in a mapped hierarchy but - * the field $fieldName is defined on a subclass, specify that here. - * If not specified, the field is assumed to belong to the class - * designated by $alias. + * @param string $alias The alias of the root entity or joined entity to which the field belongs. + * @param string $columnName The name of the column in the SQL result set. + * @param string $fieldName The name of the field on the declaring class. + * @param string|null $declaringClass The name of the class that declares/owns the specified field. + * When $alias refers to a superclass in a mapped hierarchy but + * the field $fieldName is defined on a subclass, specify that here. + * If not specified, the field is assumed to belong to the class + * designated by $alias. + * * @return ResultSetMapping This ResultSetMapping instance. + * * @todo Rename: addField */ public function addFieldResult($alias, $columnName, $fieldName, $declaringClass = null) @@ -286,11 +329,14 @@ class ResultSetMapping /** * Adds a joined entity result. * - * @param string $class The class name of the joined entity. - * @param string $alias The unique alias to use for the joined entity. + * @param string $class The class name of the joined entity. + * @param string $alias The unique alias to use for the joined entity. * @param string $parentAlias The alias of the entity result that is the parent of this joined result. - * @param object $relation The association field that connects the parent entity result with the joined entity result. + * @param object $relation The association field that connects the parent entity result + * with the joined entity result. + * * @return ResultSetMapping This ResultSetMapping instance. + * * @todo Rename: addJoinedEntity */ public function addJoinedEntityResult($class, $alias, $parentAlias, $relation) @@ -306,8 +352,8 @@ class ResultSetMapping * Adds a scalar result mapping. * * @param string $columnName The name of the column in the SQL result set. - * @param string $alias The result alias with which the scalar result should be placed in the result structure. - * @param string $type The column type + * @param string $alias The result alias with which the scalar result should be placed in the result structure. + * @param string $type The column type * * @return ResultSetMapping This ResultSetMapping instance. * @@ -328,8 +374,10 @@ class ResultSetMapping /** * Checks whether a column with a given name is mapped as a scalar result. * - * @param string $columName The name of the column in the SQL result set. + * @param string $columnName The name of the column in the SQL result set. + * * @return boolean + * * @todo Rename: isScalar */ public function isScalarResult($columnName) @@ -342,6 +390,7 @@ class ResultSetMapping * identified by the given unique alias. * * @param string $alias + * * @return string */ public function getClassName($alias) @@ -353,6 +402,7 @@ class ResultSetMapping * Gets the field alias for a column that is mapped as a scalar value. * * @param string $columnName The name of the column in the SQL result set. + * * @return string */ public function getScalarAlias($columnName) @@ -364,6 +414,7 @@ class ResultSetMapping * Gets the name of the class that owns a field mapping for the specified column. * * @param string $columnName + * * @return string */ public function getDeclaringClass($columnName) @@ -372,8 +423,8 @@ class ResultSetMapping } /** - * * @param string $alias + * * @return AssociationMapping */ public function getRelation($alias) @@ -382,8 +433,8 @@ class ResultSetMapping } /** - * * @param string $alias + * * @return boolean */ public function isRelation($alias) @@ -395,6 +446,7 @@ class ResultSetMapping * Gets the alias of the class that owns a field mapping for the specified column. * * @param string $columnName + * * @return string */ public function getEntityAlias($columnName) @@ -406,6 +458,7 @@ class ResultSetMapping * Gets the parent alias of the given alias. * * @param string $alias + * * @return string */ public function getParentAlias($alias) @@ -417,6 +470,7 @@ class ResultSetMapping * Checks whether the given alias has a parent alias. * * @param string $alias + * * @return boolean */ public function hasParentAlias($alias) @@ -428,6 +482,7 @@ class ResultSetMapping * Gets the field name for a column name. * * @param string $columnName + * * @return string */ public function getFieldName($columnName) @@ -436,7 +491,6 @@ class ResultSetMapping } /** - * * @return array */ public function getAliasMap() @@ -456,6 +510,7 @@ class ResultSetMapping /** * Checks whether this ResultSetMapping defines a mixed result. + * * Mixed results can only occur in object and array (graph) hydration. In such a * case a mixed result means that scalar values are mixed with objects/array in * the result. @@ -473,7 +528,8 @@ class ResultSetMapping * @param string $alias * @param string $columnName * @param string $fieldName - * @param bool + * @param bool $isIdentifierColumn + * * @return ResultSetMapping This ResultSetMapping instance. */ public function addMetaResult($alias, $columnName, $fieldName, $isIdentifierColumn = false) diff --git a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php index c47ef6c9d..da7ce2565 100644 --- a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php +++ b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php @@ -23,7 +23,7 @@ use Doctrine\ORM\EntityManager; use Doctrine\ORM\Mapping\ClassMetadataInfo; /** - * A ResultSetMappingBuilder uses the EntityManager to automatically populate entity fields + * A ResultSetMappingBuilder uses the EntityManager to automatically populate entity fields. * * @author Michael Ridgway * @since 2.1 @@ -37,7 +37,7 @@ class ResultSetMappingBuilder extends ResultSetMapping * * @var int */ - const COLUMN_RENAMING_NONE = 1; + const COLUMN_RENAMING_NONE = 1; /** * Picking custom renaming allows the user to define the renaming @@ -46,7 +46,7 @@ class ResultSetMappingBuilder extends ResultSetMapping * * @var int */ - const COLUMN_RENAMING_CUSTOM = 2; + const COLUMN_RENAMING_CUSTOM = 2; /** * Incremental renaming uses a result set mapping internal counter to add a @@ -77,7 +77,7 @@ class ResultSetMappingBuilder extends ResultSetMapping /** * @param EntityManager $em - * @param integer $defaultRenameMode + * @param integer $defaultRenameMode */ public function __construct(EntityManager $em, $defaultRenameMode = self::COLUMN_RENAMING_NONE) { @@ -88,10 +88,12 @@ class ResultSetMappingBuilder extends ResultSetMapping /** * Adds a root entity and all of its fields to the result set. * - * @param string $class The class name of the root entity. - * @param string $alias The unique alias to use for the root entity. - * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName) - * @param int $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM). + * @param string $class The class name of the root entity. + * @param string $alias The unique alias to use for the root entity. + * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName). + * @param int|null $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM). + * + * @return void */ public function addRootEntityFromClassMetadata($class, $alias, $renamedColumns = array(), $renameMode = null) { @@ -105,12 +107,15 @@ class ResultSetMappingBuilder extends ResultSetMapping /** * Adds a joined entity and all of its fields to the result set. * - * @param string $class The class name of the joined entity. - * @param string $alias The unique alias to use for the joined entity. - * @param string $parentAlias The alias of the entity result that is the parent of this joined result. - * @param object $relation The association field that connects the parent entity result with the joined entity result. - * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName) - * @param int $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM). + * @param string $class The class name of the joined entity. + * @param string $alias The unique alias to use for the joined entity. + * @param string $parentAlias The alias of the entity result that is the parent of this joined result. + * @param object $relation The association field that connects the parent entity result + * with the joined entity result. + * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName). + * @param int|null $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM). + * + * @return void */ public function addJoinedEntityFromClassMetadata($class, $alias, $parentAlias, $relation, $renamedColumns = array(), $renameMode = null) { @@ -122,7 +127,15 @@ class ResultSetMappingBuilder extends ResultSetMapping } /** - * Adds all fields of the given class to the result set mapping (columns and meta fields) + * Adds all fields of the given class to the result set mapping (columns and meta fields). + * + * @param string $class + * @param string $alias + * @param array $columnAliasMap + * + * @return void + * + * @throws \InvalidArgumentException */ protected function addAllClassFields($class, $alias, $columnAliasMap = array()) { @@ -162,11 +175,11 @@ class ResultSetMappingBuilder extends ResultSetMapping } /** - * Get column alias for a given column. + * Gets column alias for a given column. * * @param string $columnName - * @param int $mode - * @param array $customRenameColumns + * @param int $mode + * @param array $customRenameColumns * * @return string */ @@ -187,14 +200,13 @@ class ResultSetMappingBuilder extends ResultSetMapping } /** - * Retrieve a class columns and join columns aliases that are used - * in the SELECT clause. + * Retrieves a class columns and join columns aliases that are used in the SELECT clause. * * This depends on the renaming mode selected by the user. * * @param string $className - * @param int $mode - * @param array $customRenameColumns + * @param int $mode + * @param array $customRenameColumns * * @return array */ @@ -220,18 +232,16 @@ class ResultSetMappingBuilder extends ResultSetMapping } } - return $columnAlias; } - - /** * Adds the mappings of the results of native SQL queries to the result set. * - * @param ClassMetadataInfo $class - * @param array $queryMapping - * @return ResultSetMappingBuilder + * @param ClassMetadataInfo $class + * @param array $queryMapping + * + * @return ResultSetMappingBuilder */ public function addNamedNativeQueryMapping(ClassMetadataInfo $class, array $queryMapping) { @@ -245,8 +255,9 @@ class ResultSetMappingBuilder extends ResultSetMapping /** * Adds the class mapping of the results of native SQL queries to the result set. * - * @param ClassMetadataInfo $class - * @param string $resultClassName + * @param ClassMetadataInfo $class + * @param string $resultClassName + * * @return ResultSetMappingBuilder */ public function addNamedNativeQueryResultClassMapping(ClassMetadataInfo $class, $resultClassName) @@ -283,9 +294,10 @@ class ResultSetMappingBuilder extends ResultSetMapping /** * Adds the result set mapping of the results of native SQL queries to the result set. * - * @param ClassMetadataInfo $class - * @param string $resultSetMappingName - * @return ResultSetMappingBuilder + * @param ClassMetadataInfo $class + * @param string $resultSetMappingName + * + * @return ResultSetMappingBuilder */ public function addNamedNativeQueryResultSetMapping(ClassMetadataInfo $class, $resultSetMappingName) { @@ -329,9 +341,12 @@ class ResultSetMappingBuilder extends ResultSetMapping * Adds the entity result mapping of the results of native SQL queries to the result set. * * @param ClassMetadataInfo $classMetadata - * @param array $entityMapping - * @param string $alias + * @param array $entityMapping + * @param string $alias + * * @return ResultSetMappingBuilder + * + * @throws \InvalidArgumentException */ public function addNamedNativeQueryEntityResultMapping(ClassMetadataInfo $classMetadata, array $entityMapping, $alias) { @@ -380,11 +395,13 @@ class ResultSetMappingBuilder extends ResultSetMapping } /** - * Generate the Select clause from this ResultSetMappingBuilder + * Generates the Select clause from this ResultSetMappingBuilder. * * Works only for all the entity results. The select parts for scalar * expressions have to be written manually. * + * @param array $tableAliases + * * @return string */ public function generateSelectClause($tableAliases = array()) @@ -416,6 +433,9 @@ class ResultSetMappingBuilder extends ResultSetMapping return $sql; } + /** + * @return string + */ public function __toString() { return $this->generateSelectClause(array()); diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index 71c09c0a2..0e01d9c5b 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -51,35 +51,35 @@ class SqlWalker implements TreeWalker private $rsm; /** - * Counters for generating unique column aliases. + * Counter for generating unique column aliases. * * @var integer */ private $aliasCounter = 0; /** - * Counters for generating unique table aliases. + * Counter for generating unique table aliases. * * @var integer */ private $tableAliasCounter = 0; /** - * Counters for generating unique scalar result. + * Counter for generating unique scalar result. * * @var integer */ private $scalarResultCounter = 1; /** - * Counters for generating unique parameter indexes. + * Counter for generating unique parameter indexes. * * @var integer */ private $sqlParamIndex = 0; /** - * Counters for generating indexes. + * Counter for generating indexes. * * @var integer */ @@ -91,7 +91,7 @@ class SqlWalker implements TreeWalker private $parserResult; /** - * @var EntityManager + * @var \Doctrine\ORM\EntityManager */ private $em; @@ -101,7 +101,7 @@ class SqlWalker implements TreeWalker private $conn; /** - * @var AbstractQuery + * @var \Doctrine\ORM\AbstractQuery */ private $query; @@ -118,7 +118,7 @@ class SqlWalker implements TreeWalker private $scalarResultAliasMap = array(); /** - * Map from DQL-Alias + Field-Name to SQL Column Alias + * Map from DQL-Alias + Field-Name to SQL Column Alias. * * @var array */ @@ -156,7 +156,7 @@ class SqlWalker implements TreeWalker /** * The database platform abstraction. * - * @var AbstractPlatform + * @var \Doctrine\DBAL\Platforms\AbstractPlatform */ private $platform; @@ -195,7 +195,7 @@ class SqlWalker implements TreeWalker /** * Gets the Connection used by the walker. * - * @return Connection + * @return \Doctrine\DBAL\Connection */ public function getConnection() { @@ -216,6 +216,7 @@ class SqlWalker implements TreeWalker * Gets the information about a single query component. * * @param string $dqlAlias The DQL alias. + * * @return array */ public function getQueryComponent($dqlAlias) @@ -224,9 +225,7 @@ class SqlWalker implements TreeWalker } /** - * Return internal queryComponents array - * - * @return array + * {@inheritdoc} */ public function getQueryComponents() { @@ -234,10 +233,7 @@ class SqlWalker implements TreeWalker } /** - * Set or override a query component for a given dql alias. - * - * @param string $dqlAlias The DQL alias. - * @param array $queryComponent + * {@inheritdoc} */ public function setQueryComponent($dqlAlias, array $queryComponent) { @@ -251,9 +247,7 @@ class SqlWalker implements TreeWalker } /** - * Gets an executor that can be used to execute the result of this walker. - * - * @return AbstractExecutor + * {@inheritdoc} */ public function getExecutor($AST) { @@ -281,7 +275,8 @@ class SqlWalker implements TreeWalker * Generates a unique, short SQL table alias. * * @param string $tableName Table name - * @param string $dqlAlias The DQL alias. + * @param string $dqlAlias The DQL alias. + * * @return string Generated table alias. */ public function getSQLTableAlias($tableName, $dqlAlias = '') @@ -302,6 +297,7 @@ class SqlWalker implements TreeWalker * @param string $tableName * @param string $alias * @param string $dqlAlias + * * @return string */ public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') @@ -317,6 +313,7 @@ class SqlWalker implements TreeWalker * Gets an SQL column alias for a column name. * * @param string $columnName + * * @return string */ public function getSQLColumnAlias($columnName) @@ -328,8 +325,9 @@ class SqlWalker implements TreeWalker * Generates the SQL JOINs that are necessary for Class Table Inheritance * for the given class. * - * @param ClassMetadata $class The class for which to generate the joins. - * @param string $dqlAlias The DQL alias of the class. + * @param ClassMetadata $class The class for which to generate the joins. + * @param string $dqlAlias The DQL alias of the class. + * * @return string The SQL. */ private function _generateClassTableInheritanceJoins($class, $dqlAlias) @@ -385,6 +383,9 @@ class SqlWalker implements TreeWalker return $sql; } + /** + * @return string + */ private function _generateOrderedCollectionOrderByItems() { $sqlParts = array(); @@ -412,6 +413,7 @@ class SqlWalker implements TreeWalker * Generates a discriminator column SQL condition for the class with the given DQL alias. * * @param array $dqlAliases List of root DQL aliases to inspect for discriminator restrictions. + * * @return string */ private function _generateDiscriminatorColumnConditionSQL(array $dqlAliases) @@ -446,8 +448,8 @@ class SqlWalker implements TreeWalker /** * Generates the filter SQL for a given entity and table alias. * - * @param ClassMetadata $targetEntity Metadata of the target entity. - * @param string $targetTableAlias The table alias of the joined/selected table. + * @param ClassMetadata $targetEntity Metadata of the target entity. + * @param string $targetTableAlias The table alias of the joined/selected table. * * @return string The SQL query part to add to a query. */ @@ -487,10 +489,9 @@ class SqlWalker implements TreeWalker return implode(' AND ', $filterClauses); } + /** - * Walks down a SelectStatement AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ public function walkSelectStatement(AST\SelectStatement $AST) { @@ -539,10 +540,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL. - * - * @param UpdateStatement - * @return string The SQL. + * {@inheritdoc} */ public function walkUpdateStatement(AST\UpdateStatement $AST) { @@ -553,10 +551,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL. - * - * @param DeleteStatement - * @return string The SQL. + * {@inheritdoc} */ public function walkDeleteStatement(AST\DeleteStatement $AST) { @@ -571,6 +566,7 @@ class SqlWalker implements TreeWalker * This one differs of ->walkIdentificationVariable() because it generates the entity identifiers. * * @param string $identVariable + * * @return string */ public function walkEntityIdentificationVariable($identVariable) @@ -591,6 +587,7 @@ class SqlWalker implements TreeWalker * * @param string $identificationVariable * @param string $fieldName + * * @return string The SQL. */ public function walkIdentificationVariable($identificationVariable, $fieldName = null) @@ -608,10 +605,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a PathExpression AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkPathExpression($pathExpr) { @@ -667,10 +661,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a SelectClause AST node, thereby generating the appropriate SQL. - * - * @param $selectClause - * @return string The SQL. + * {@inheritdoc} */ public function walkSelectClause($selectClause) { @@ -775,9 +766,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a FromClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ public function walkFromClause($fromClause) { @@ -814,6 +803,8 @@ class SqlWalker implements TreeWalker /** * Walks down a RangeVariableDeclaration AST node, thereby generating the appropriate SQL. * + * @param AST\RangeVariableDeclaration $rangeVariableDeclaration + * * @return string */ public function walkRangeVariableDeclaration($rangeVariableDeclaration) @@ -836,7 +827,12 @@ class SqlWalker implements TreeWalker /** * Walks down a JoinAssociationDeclaration AST node, thereby generating the appropriate SQL. * + * @param AST\JoinAssociationDeclaration $joinAssociationDeclaration + * @param int $joinType + * * @return string + * + * @throws QueryException */ public function walkJoinAssociationDeclaration($joinAssociationDeclaration, $joinType = AST\Join::JOIN_TYPE_INNER) { @@ -973,9 +969,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a FunctionNode AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ public function walkFunction($function) { @@ -983,10 +977,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an OrderByClause AST node, thereby generating the appropriate SQL. - * - * @param OrderByClause - * @return string The SQL. + * {@inheritdoc} */ public function walkOrderByClause($orderByClause) { @@ -1000,10 +991,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an OrderByItem AST node, thereby generating the appropriate SQL. - * - * @param OrderByItem - * @return string The SQL. + * {@inheritdoc} */ public function walkOrderByItem($orderByItem) { @@ -1016,10 +1004,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a HavingClause AST node, thereby generating the appropriate SQL. - * - * @param HavingClause - * @return string The SQL. + * {@inheritdoc} */ public function walkHavingClause($havingClause) { @@ -1027,9 +1012,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a Join AST node and creates the corresponding SQL. - * - * @return string The SQL. + * {@inheritdoc} */ public function walkJoin($join) { @@ -1069,7 +1052,8 @@ class SqlWalker implements TreeWalker /** * Walks down a CaseExpression AST node and generates the corresponding SQL. * - * @param CoalesceExpression|NullIfExpression|GeneralCaseExpression|SimpleCaseExpression $expression + * @param AST\CoalesceExpression|AST\NullIfExpression|AST\GeneralCaseExpression|AST\SimpleCaseExpression $expression + * * @return string The SQL. */ public function walkCaseExpression($expression) @@ -1095,7 +1079,8 @@ class SqlWalker implements TreeWalker /** * Walks down a CoalesceExpression AST node and generates the corresponding SQL. * - * @param CoalesceExpression $coalesceExpression + * @param AST\CoalesceExpression $coalesceExpression + * * @return string The SQL. */ public function walkCoalesceExpression($coalesceExpression) @@ -1116,7 +1101,8 @@ class SqlWalker implements TreeWalker /** * Walks down a NullIfExpression AST node and generates the corresponding SQL. * - * @param NullIfExpression $nullIfExpression + * @param AST\NullIfExpression $nullIfExpression + * * @return string The SQL. */ public function walkNullIfExpression($nullIfExpression) @@ -1135,7 +1121,8 @@ class SqlWalker implements TreeWalker /** * Walks down a GeneralCaseExpression AST node and generates the corresponding SQL. * - * @param GeneralCaseExpression $generalCaseExpression + * @param AST\GeneralCaseExpression $generalCaseExpression + * * @return string The SQL. */ public function walkGeneralCaseExpression(AST\GeneralCaseExpression $generalCaseExpression) @@ -1155,7 +1142,8 @@ class SqlWalker implements TreeWalker /** * Walks down a SimpleCaseExpression AST node and generates the corresponding SQL. * - * @param SimpleCaseExpression $simpleCaseExpression + * @param AST\SimpleCaseExpression $simpleCaseExpression + * * @return string The SQL. */ public function walkSimpleCaseExpression($simpleCaseExpression) @@ -1173,10 +1161,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a SelectExpression AST node and generates the corresponding SQL. - * - * @param SelectExpression $selectExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkSelectExpression($selectExpression) { @@ -1356,10 +1341,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL. - * - * @param QuantifiedExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkQuantifiedExpression($qExpr) { @@ -1367,10 +1349,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a Subselect AST node, thereby generating the appropriate SQL. - * - * @param Subselect - * @return string The SQL. + * {@inheritdoc} */ public function walkSubselect($subselect) { @@ -1395,10 +1374,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL. - * - * @param SubselectFromClause - * @return string The SQL. + * {@inheritdoc} */ public function walkSubselectFromClause($subselectFromClause) { @@ -1419,10 +1395,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectClause - * @return string The SQL. + * {@inheritdoc} */ public function walkSimpleSelectClause($simpleSelectClause) { @@ -1431,7 +1404,8 @@ class SqlWalker implements TreeWalker } /** - * @param AST\NewObjectExpression + * @param AST\NewObjectExpression $newObjectExpression + * * @return string The SQL. */ public function walkNewObject($newObjectExpression) @@ -1493,10 +1467,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkSimpleSelectExpression($simpleSelectExpression) { @@ -1549,10 +1520,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL. - * - * @param AggregateExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkAggregateExpression($aggExpression) { @@ -1561,10 +1529,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a GroupByClause AST node, thereby generating the appropriate SQL. - * - * @param GroupByClause - * @return string The SQL. + * {@inheritdoc} */ public function walkGroupByClause($groupByClause) { @@ -1578,10 +1543,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a GroupByItem AST node, thereby generating the appropriate SQL. - * - * @param GroupByItem - * @return string The SQL. + * {@inheritdoc} */ public function walkGroupByItem($groupByItem) { @@ -1618,10 +1580,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a DeleteClause AST node, thereby generating the appropriate SQL. - * - * @param DeleteClause - * @return string The SQL. + * {@inheritdoc} */ public function walkDeleteClause(AST\DeleteClause $deleteClause) { @@ -1636,10 +1595,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an UpdateClause AST node, thereby generating the appropriate SQL. - * - * @param UpdateClause - * @return string The SQL. + * {@inheritdoc} */ public function walkUpdateClause($updateClause) { @@ -1656,10 +1612,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an UpdateItem AST node, thereby generating the appropriate SQL. - * - * @param UpdateItem - * @return string The SQL. + * {@inheritdoc} */ public function walkUpdateItem($updateItem) { @@ -1689,11 +1642,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a WhereClause AST node, thereby generating the appropriate SQL. - * WhereClause or not, the appropriate discriminator sql is added. - * - * @param WhereClause - * @return string The SQL. + * {@inheritdoc} */ public function walkWhereClause($whereClause) { @@ -1732,10 +1681,7 @@ class SqlWalker implements TreeWalker } /** - * Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL. - * - * @param ConditionalExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkConditionalExpression($condExpr) { @@ -1749,10 +1695,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL. - * - * @param ConditionalTerm - * @return string The SQL. + * {@inheritdoc} */ public function walkConditionalTerm($condTerm) { @@ -1766,10 +1709,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL. - * - * @param ConditionalFactor - * @return string The SQL. + * {@inheritdoc} */ public function walkConditionalFactor($factor) { @@ -1781,10 +1721,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL. - * - * @param ConditionalPrimary - * @return string The SQL. + * {@inheritdoc} */ public function walkConditionalPrimary($primary) { @@ -1800,10 +1737,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL. - * - * @param ExistsExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkExistsExpression($existsExpr) { @@ -1815,10 +1749,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL. - * - * @param CollectionMemberExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkCollectionMemberExpression($collMemberExpr) { @@ -1928,10 +1859,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param EmptyCollectionComparisonExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) { @@ -1942,10 +1870,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param NullComparisonExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkNullComparisonExpression($nullCompExpr) { @@ -1966,10 +1891,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an InExpression AST node, thereby generating the appropriate SQL. - * - * @param InExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkInExpression($inExpr) { @@ -1985,10 +1907,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL. - * - * @param InstanceOfExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkInstanceOfExpression($instanceOfExpr) { @@ -2045,10 +1964,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an InParameter AST node, thereby generating the appropriate SQL. - * - * @param InParameter - * @return string The SQL. + * {@inheritdoc} */ public function walkInParameter($inParam) { @@ -2058,10 +1974,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a literal that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkLiteral($literal) { @@ -2084,10 +1997,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL. - * - * @param BetweenExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkBetweenExpression($betweenExpr) { @@ -2102,10 +2012,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a LikeExpression AST node, thereby generating the appropriate SQL. - * - * @param LikeExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkLikeExpression($likeExpr) { @@ -2133,10 +2040,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL. - * - * @param StateFieldPathExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkStateFieldPathExpression($stateFieldPathExpression) { @@ -2144,10 +2048,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param ComparisonExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkComparisonExpression($compExpr) { @@ -2169,10 +2070,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an InputParameter AST node, thereby generating the appropriate SQL. - * - * @param InputParameter - * @return string The SQL. + * {@inheritdoc} */ public function walkInputParameter($inputParam) { @@ -2182,10 +2080,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param ArithmeticExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkArithmeticExpression($arithmeticExpr) { @@ -2195,10 +2090,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleArithmeticExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkSimpleArithmeticExpression($simpleArithmeticExpr) { @@ -2210,10 +2102,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkArithmeticTerm($term) { @@ -2233,10 +2122,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkArithmeticFactor($factor) { @@ -2258,7 +2144,8 @@ class SqlWalker implements TreeWalker /** * Walks down an ArithmeticPrimary that represents an AST node, thereby generating the appropriate SQL. * - * @param mixed + * @param mixed $primary + * * @return string The SQL. */ public function walkArithmeticPrimary($primary) @@ -2275,10 +2162,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkStringPrimary($stringPrimary) { @@ -2288,10 +2172,7 @@ class SqlWalker implements TreeWalker } /** - * Walks down a ResultVriable that represents an AST node, thereby generating the appropriate SQL. - * - * @param string $resultVariable - * @return string The SQL. + * {@inheritdoc} */ public function walkResultVariable($resultVariable) { diff --git a/lib/Doctrine/ORM/Query/TreeWalker.php b/lib/Doctrine/ORM/Query/TreeWalker.php index ceb117c0a..9ddd86b04 100644 --- a/lib/Doctrine/ORM/Query/TreeWalker.php +++ b/lib/Doctrine/ORM/Query/TreeWalker.php @@ -28,32 +28,36 @@ namespace Doctrine\ORM\Query; interface TreeWalker { /** - * Initializes TreeWalker with important information about the ASTs to be walked + * Initializes TreeWalker with important information about the ASTs to be walked. * - * @param Query $query The parsed Query. - * @param ParserResult $parserResult The result of the parsing process. - * @param array $queryComponents Query components (symbol table) + * @param \Doctrine\ORM\AbstractQuery $query The parsed Query. + * @param \Doctrine\ORM\Query\ParserResult $parserResult The result of the parsing process. + * @param array $queryComponents The query components (symbol table). */ public function __construct($query, $parserResult, array $queryComponents); - /** - * Return internal queryComponents array - * - * @return array - */ - public function getQueryComponents(); - - /** - * Set or override a query component for a given dql alias. - * - * @param string $dqlAlias The DQL alias. - * @param array $queryComponent - */ - public function setQueryComponent($dqlAlias, array $queryComponent); + /** + * Returns internal queryComponents array. + * + * @return array + */ + public function getQueryComponents(); + + /** + * Sets or overrides a query component for a given dql alias. + * + * @param string $dqlAlias The DQL alias. + * @param array $queryComponent + * + * @return void + */ + public function setQueryComponent($dqlAlias, array $queryComponent); /** * Walks down a SelectStatement AST node, thereby generating the appropriate SQL. * + * @param AST\SelectStatement $AST + * * @return string The SQL. */ function walkSelectStatement(AST\SelectStatement $AST); @@ -61,6 +65,8 @@ interface TreeWalker /** * Walks down a SelectClause AST node, thereby generating the appropriate SQL. * + * @param AST\SelectClause $selectClause + * * @return string The SQL. */ function walkSelectClause($selectClause); @@ -68,6 +74,8 @@ interface TreeWalker /** * Walks down a FromClause AST node, thereby generating the appropriate SQL. * + * @param AST\FromClause $fromClause + * * @return string The SQL. */ function walkFromClause($fromClause); @@ -75,6 +83,8 @@ interface TreeWalker /** * Walks down a FunctionNode AST node, thereby generating the appropriate SQL. * + * @param AST\Functions\FunctionNode $function + * * @return string The SQL. */ function walkFunction($function); @@ -82,7 +92,8 @@ interface TreeWalker /** * Walks down an OrderByClause AST node, thereby generating the appropriate SQL. * - * @param OrderByClause + * @param AST\OrderByClause $orderByClause + * * @return string The SQL. */ function walkOrderByClause($orderByClause); @@ -90,7 +101,8 @@ interface TreeWalker /** * Walks down an OrderByItem AST node, thereby generating the appropriate SQL. * - * @param OrderByItem + * @param AST\OrderByItem $orderByItem + * * @return string The SQL. */ function walkOrderByItem($orderByItem); @@ -98,7 +110,8 @@ interface TreeWalker /** * Walks down a HavingClause AST node, thereby generating the appropriate SQL. * - * @param HavingClause + * @param AST\HavingClause $havingClause + * * @return string The SQL. */ function walkHavingClause($havingClause); @@ -106,7 +119,8 @@ interface TreeWalker /** * Walks down a Join AST node and creates the corresponding SQL. * - * @param Join $joinVarDecl + * @param AST\Join $join + * * @return string The SQL. */ function walkJoin($join); @@ -114,7 +128,8 @@ interface TreeWalker /** * Walks down a SelectExpression AST node and generates the corresponding SQL. * - * @param SelectExpression $selectExpression + * @param AST\SelectExpression $selectExpression + * * @return string The SQL. */ function walkSelectExpression($selectExpression); @@ -122,7 +137,8 @@ interface TreeWalker /** * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL. * - * @param QuantifiedExpression + * @param AST\QuantifiedExpression $qExpr + * * @return string The SQL. */ function walkQuantifiedExpression($qExpr); @@ -130,7 +146,8 @@ interface TreeWalker /** * Walks down a Subselect AST node, thereby generating the appropriate SQL. * - * @param Subselect + * @param AST\Subselect $subselect + * * @return string The SQL. */ function walkSubselect($subselect); @@ -138,7 +155,8 @@ interface TreeWalker /** * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL. * - * @param SubselectFromClause + * @param AST\SubselectFromClause $subselectFromClause + * * @return string The SQL. */ function walkSubselectFromClause($subselectFromClause); @@ -146,7 +164,8 @@ interface TreeWalker /** * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL. * - * @param SimpleSelectClause + * @param AST\SimpleSelectClause $simpleSelectClause + * * @return string The SQL. */ function walkSimpleSelectClause($simpleSelectClause); @@ -154,7 +173,8 @@ interface TreeWalker /** * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL. * - * @param SimpleSelectExpression + * @param AST\SimpleSelectExpression $simpleSelectExpression + * * @return string The SQL. */ function walkSimpleSelectExpression($simpleSelectExpression); @@ -162,7 +182,8 @@ interface TreeWalker /** * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL. * - * @param AggregateExpression + * @param AST\AggregateExpression $aggExpression + * * @return string The SQL. */ function walkAggregateExpression($aggExpression); @@ -170,7 +191,8 @@ interface TreeWalker /** * Walks down a GroupByClause AST node, thereby generating the appropriate SQL. * - * @param GroupByClause + * @param AST\GroupByClause $groupByClause + * * @return string The SQL. */ function walkGroupByClause($groupByClause); @@ -178,7 +200,8 @@ interface TreeWalker /** * Walks down a GroupByItem AST node, thereby generating the appropriate SQL. * - * @param GroupByItem + * @param AST\PathExpression|string $groupByItem + * * @return string The SQL. */ function walkGroupByItem($groupByItem); @@ -186,7 +209,8 @@ interface TreeWalker /** * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL. * - * @param UpdateStatement + * @param AST\UpdateStatement $AST + * * @return string The SQL. */ function walkUpdateStatement(AST\UpdateStatement $AST); @@ -194,7 +218,8 @@ interface TreeWalker /** * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL. * - * @param DeleteStatement + * @param AST\DeleteStatement $AST + * * @return string The SQL. */ function walkDeleteStatement(AST\DeleteStatement $AST); @@ -202,7 +227,8 @@ interface TreeWalker /** * Walks down a DeleteClause AST node, thereby generating the appropriate SQL. * - * @param DeleteClause + * @param AST\DeleteClause $deleteClause + * * @return string The SQL. */ function walkDeleteClause(AST\DeleteClause $deleteClause); @@ -210,7 +236,8 @@ interface TreeWalker /** * Walks down an UpdateClause AST node, thereby generating the appropriate SQL. * - * @param UpdateClause + * @param AST\UpdateClause $updateClause + * * @return string The SQL. */ function walkUpdateClause($updateClause); @@ -218,23 +245,27 @@ interface TreeWalker /** * Walks down an UpdateItem AST node, thereby generating the appropriate SQL. * - * @param UpdateItem + * @param AST\UpdateItem $updateItem + * * @return string The SQL. */ function walkUpdateItem($updateItem); /** * Walks down a WhereClause AST node, thereby generating the appropriate SQL. + * WhereClause or not, the appropriate discriminator sql is added. + * + * @param AST\WhereClause $whereClause * - * @param WhereClause * @return string The SQL. */ function walkWhereClause($whereClause); /** - * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL. + * Walk down a ConditionalExpression AST node, thereby generating the appropriate SQL. + * + * @param AST\ConditionalExpression $condExpr * - * @param ConditionalExpression * @return string The SQL. */ function walkConditionalExpression($condExpr); @@ -242,7 +273,8 @@ interface TreeWalker /** * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL. * - * @param ConditionalTerm + * @param AST\ConditionalTerm $condTerm + * * @return string The SQL. */ function walkConditionalTerm($condTerm); @@ -250,7 +282,8 @@ interface TreeWalker /** * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL. * - * @param ConditionalFactor + * @param AST\ConditionalFactor $factor + * * @return string The SQL. */ function walkConditionalFactor($factor); @@ -258,7 +291,8 @@ interface TreeWalker /** * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL. * - * @param ConditionalPrimary + * @param AST\ConditionalPrimary $primary + * * @return string The SQL. */ function walkConditionalPrimary($primary); @@ -266,7 +300,8 @@ interface TreeWalker /** * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL. * - * @param ExistsExpression + * @param AST\ExistsExpression $existsExpr + * * @return string The SQL. */ function walkExistsExpression($existsExpr); @@ -274,7 +309,8 @@ interface TreeWalker /** * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL. * - * @param CollectionMemberExpression + * @param AST\CollectionMemberExpression $collMemberExpr + * * @return string The SQL. */ function walkCollectionMemberExpression($collMemberExpr); @@ -282,7 +318,8 @@ interface TreeWalker /** * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL. * - * @param EmptyCollectionComparisonExpression + * @param AST\EmptyCollectionComparisonExpression $emptyCollCompExpr + * * @return string The SQL. */ function walkEmptyCollectionComparisonExpression($emptyCollCompExpr); @@ -290,7 +327,8 @@ interface TreeWalker /** * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL. * - * @param NullComparisonExpression + * @param AST\NullComparisonExpression $nullCompExpr + * * @return string The SQL. */ function walkNullComparisonExpression($nullCompExpr); @@ -298,7 +336,8 @@ interface TreeWalker /** * Walks down an InExpression AST node, thereby generating the appropriate SQL. * - * @param InExpression + * @param AST\InExpression $inExpr + * * @return string The SQL. */ function walkInExpression($inExpr); @@ -306,7 +345,8 @@ interface TreeWalker /** * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL. * - * @param InstanceOfExpression + * @param AST\InstanceOfExpression $instanceOfExpr + * * @return string The SQL. */ function walkInstanceOfExpression($instanceOfExpr); @@ -314,7 +354,8 @@ interface TreeWalker /** * Walks down a literal that represents an AST node, thereby generating the appropriate SQL. * - * @param mixed + * @param mixed $literal + * * @return string The SQL. */ function walkLiteral($literal); @@ -322,7 +363,8 @@ interface TreeWalker /** * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL. * - * @param BetweenExpression + * @param AST\BetweenExpression $betweenExpr + * * @return string The SQL. */ function walkBetweenExpression($betweenExpr); @@ -330,7 +372,8 @@ interface TreeWalker /** * Walks down a LikeExpression AST node, thereby generating the appropriate SQL. * - * @param LikeExpression + * @param AST\LikeExpression $likeExpr + * * @return string The SQL. */ function walkLikeExpression($likeExpr); @@ -338,7 +381,8 @@ interface TreeWalker /** * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL. * - * @param StateFieldPathExpression + * @param AST\PathExpression $stateFieldPathExpression + * * @return string The SQL. */ function walkStateFieldPathExpression($stateFieldPathExpression); @@ -346,7 +390,8 @@ interface TreeWalker /** * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL. * - * @param ComparisonExpression + * @param AST\ComparisonExpression $compExpr + * * @return string The SQL. */ function walkComparisonExpression($compExpr); @@ -354,7 +399,8 @@ interface TreeWalker /** * Walks down an InputParameter AST node, thereby generating the appropriate SQL. * - * @param InputParameter + * @param AST\InputParameter $inputParam + * * @return string The SQL. */ function walkInputParameter($inputParam); @@ -362,7 +408,8 @@ interface TreeWalker /** * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL. * - * @param ArithmeticExpression + * @param AST\ArithmeticExpression $arithmeticExpr + * * @return string The SQL. */ function walkArithmeticExpression($arithmeticExpr); @@ -370,7 +417,8 @@ interface TreeWalker /** * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL. * - * @param mixed + * @param mixed $term + * * @return string The SQL. */ function walkArithmeticTerm($term); @@ -378,7 +426,8 @@ interface TreeWalker /** * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL. * - * @param mixed + * @param mixed $stringPrimary + * * @return string The SQL. */ function walkStringPrimary($stringPrimary); @@ -386,7 +435,8 @@ interface TreeWalker /** * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL. * - * @param mixed + * @param mixed $factor + * * @return string The SQL. */ function walkArithmeticFactor($factor); @@ -394,23 +444,26 @@ interface TreeWalker /** * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL. * - * @param SimpleArithmeticExpression + * @param AST\SimpleArithmeticExpression $simpleArithmeticExpr + * * @return string The SQL. */ function walkSimpleArithmeticExpression($simpleArithmeticExpr); /** - * Walks down an PathExpression AST node, thereby generating the appropriate SQL. + * Walks down a PathExpression AST node, thereby generating the appropriate SQL. + * + * @param mixed $pathExpr * - * @param mixed * @return string The SQL. */ function walkPathExpression($pathExpr); /** - * Walks down an ResultVariable AST node, thereby generating the appropriate SQL. + * Walks down a ResultVariable that represents an AST node, thereby generating the appropriate SQL. * * @param string $resultVariable + * * @return string The SQL. */ function walkResultVariable($resultVariable); @@ -418,7 +471,9 @@ interface TreeWalker /** * Gets an executor that can be used to execute the result of this walker. * - * @return AbstractExecutor + * @param AST\DeleteStatement|AST\UpdateStatement|AST\SelectStatement $AST + * + * @return Exec\AbstractSqlExecutor */ function getExecutor($AST); } diff --git a/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php b/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php index 32009a3c4..c285739d8 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php @@ -28,8 +28,25 @@ namespace Doctrine\ORM\Query; */ abstract class TreeWalkerAdapter implements TreeWalker { + /** + * The original Query. + * + * @var \Doctrine\ORM\AbstractQuery + */ private $_query; + + /** + * The ParserResult of the original query that was produced by the Parser. + * + * @var \Doctrine\ORM\Query\ParserResult + */ private $_parserResult; + + /** + * The query components of the original query (the "symbol table") that was produced by the Parser. + * + * @var array + */ private $_queryComponents; /** @@ -43,20 +60,15 @@ abstract class TreeWalkerAdapter implements TreeWalker } /** - * Return internal queryComponents array - * - * @return array: + * {@inheritdoc} */ public function getQueryComponents() { return $this->_queryComponents; } - + /** - * Set or override a query component for a given dql alias. - * - * @param string $dqlAlias The DQL alias. - * @param array $queryComponent + * {@inheritdoc} */ public function setQueryComponent($dqlAlias, array $queryComponent) { @@ -78,9 +90,9 @@ abstract class TreeWalkerAdapter implements TreeWalker } /** - * Retrieve Query Instance reponsible for the current walkers execution. + * Retrieves the Query Instance reponsible for the current walkers execution. * - * @return \Doctrine\ORM\Query + * @return \Doctrine\ORM\AbstractQuery */ protected function _getQuery() { @@ -88,7 +100,7 @@ abstract class TreeWalkerAdapter implements TreeWalker } /** - * Retrieve ParserResult + * Retrieves the ParserResult. * * @return \Doctrine\ORM\Query\ParserResult */ @@ -98,373 +110,331 @@ abstract class TreeWalkerAdapter implements TreeWalker } /** - * Walks down a SelectStatement AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ - public function walkSelectStatement(AST\SelectStatement $AST) {} + public function walkSelectStatement(AST\SelectStatement $AST) + { + } /** - * Walks down a SelectClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ - public function walkSelectClause($selectClause) {} + public function walkSelectClause($selectClause) + { + } /** - * Walks down a FromClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ - public function walkFromClause($fromClause) {} + public function walkFromClause($fromClause) + { + } /** - * Walks down a FunctionNode AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ - public function walkFunction($function) {} + public function walkFunction($function) + { + } /** - * Walks down an OrderByClause AST node, thereby generating the appropriate SQL. - * - * @param OrderByClause - * @return string The SQL. + * {@inheritdoc} */ - public function walkOrderByClause($orderByClause) {} + public function walkOrderByClause($orderByClause) + { + } /** - * Walks down an OrderByItem AST node, thereby generating the appropriate SQL. - * - * @param OrderByItem - * @return string The SQL. + * {@inheritdoc} */ - public function walkOrderByItem($orderByItem) {} + public function walkOrderByItem($orderByItem) + { + } /** - * Walks down a HavingClause AST node, thereby generating the appropriate SQL. - * - * @param HavingClause - * @return string The SQL. + * {@inheritdoc} */ - public function walkHavingClause($havingClause) {} + public function walkHavingClause($havingClause) + { + } /** - * Walks down a Join AST node and creates the corresponding SQL. - * - * @param Join $join - * @return string The SQL. + * {@inheritdoc} */ - public function walkJoin($join) {} + public function walkJoin($join) + { + } /** - * Walks down a SelectExpression AST node and generates the corresponding SQL. - * - * @param SelectExpression $selectExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkSelectExpression($selectExpression) {} + public function walkSelectExpression($selectExpression) + { + } /** - * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL. - * - * @param QuantifiedExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkQuantifiedExpression($qExpr) {} + public function walkQuantifiedExpression($qExpr) + { + } /** - * Walks down a Subselect AST node, thereby generating the appropriate SQL. - * - * @param Subselect - * @return string The SQL. + * {@inheritdoc} */ - public function walkSubselect($subselect) {} + public function walkSubselect($subselect) + { + } /** - * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL. - * - * @param SubselectFromClause - * @return string The SQL. + * {@inheritdoc} */ - public function walkSubselectFromClause($subselectFromClause) {} + public function walkSubselectFromClause($subselectFromClause) + { + } /** - * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectClause - * @return string The SQL. + * {@inheritdoc} */ - public function walkSimpleSelectClause($simpleSelectClause) {} + public function walkSimpleSelectClause($simpleSelectClause) + { + } /** - * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkSimpleSelectExpression($simpleSelectExpression) {} + public function walkSimpleSelectExpression($simpleSelectExpression) + { + } /** - * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL. - * - * @param AggregateExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkAggregateExpression($aggExpression) {} + public function walkAggregateExpression($aggExpression) + { + } /** - * Walks down a GroupByClause AST node, thereby generating the appropriate SQL. - * - * @param GroupByClause - * @return string The SQL. + * {@inheritdoc} */ - public function walkGroupByClause($groupByClause) {} + public function walkGroupByClause($groupByClause) + { + } /** - * Walks down a GroupByItem AST node, thereby generating the appropriate SQL. - * - * @param GroupByItem - * @return string The SQL. + * {@inheritdoc} */ - public function walkGroupByItem($groupByItem) {} + public function walkGroupByItem($groupByItem) + { + } /** - * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL. - * - * @param UpdateStatement - * @return string The SQL. + * {@inheritdoc} */ - public function walkUpdateStatement(AST\UpdateStatement $AST) {} + public function walkUpdateStatement(AST\UpdateStatement $AST) + { + } /** - * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL. - * - * @param DeleteStatement - * @return string The SQL. + * {@inheritdoc} */ - public function walkDeleteStatement(AST\DeleteStatement $AST) {} + public function walkDeleteStatement(AST\DeleteStatement $AST) + { + } /** - * Walks down a DeleteClause AST node, thereby generating the appropriate SQL. - * - * @param DeleteClause - * @return string The SQL. + * {@inheritdoc} */ - public function walkDeleteClause(AST\DeleteClause $deleteClause) {} + public function walkDeleteClause(AST\DeleteClause $deleteClause) + { + } /** - * Walks down an UpdateClause AST node, thereby generating the appropriate SQL. - * - * @param UpdateClause - * @return string The SQL. + * {@inheritdoc} */ - public function walkUpdateClause($updateClause) {} + public function walkUpdateClause($updateClause) + { + } /** - * Walks down an UpdateItem AST node, thereby generating the appropriate SQL. - * - * @param UpdateItem - * @return string The SQL. + * {@inheritdoc} */ - public function walkUpdateItem($updateItem) {} + public function walkUpdateItem($updateItem) + { + } /** - * Walks down a WhereClause AST node, thereby generating the appropriate SQL. - * - * @param WhereClause - * @return string The SQL. + * {@inheritdoc} */ - public function walkWhereClause($whereClause) {} + public function walkWhereClause($whereClause) + { + } /** - * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL. - * - * @param ConditionalExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkConditionalExpression($condExpr) {} + public function walkConditionalExpression($condExpr) + { + } /** - * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL. - * - * @param ConditionalTerm - * @return string The SQL. + * {@inheritdoc} */ - public function walkConditionalTerm($condTerm) {} + public function walkConditionalTerm($condTerm) + { + } /** - * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL. - * - * @param ConditionalFactor - * @return string The SQL. + * {@inheritdoc} */ - public function walkConditionalFactor($factor) {} + public function walkConditionalFactor($factor) + { + } /** - * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL. - * - * @param ConditionalPrimary - * @return string The SQL. + * {@inheritdoc} */ - public function walkConditionalPrimary($primary) {} + public function walkConditionalPrimary($primary) + { + } /** - * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL. - * - * @param ExistsExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkExistsExpression($existsExpr) {} + public function walkExistsExpression($existsExpr) + { + } /** - * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL. - * - * @param CollectionMemberExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkCollectionMemberExpression($collMemberExpr) {} + public function walkCollectionMemberExpression($collMemberExpr) + { + } /** - * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param EmptyCollectionComparisonExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) {} + public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) + { + } /** - * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param NullComparisonExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkNullComparisonExpression($nullCompExpr) {} + public function walkNullComparisonExpression($nullCompExpr) + { + } /** - * Walks down an InExpression AST node, thereby generating the appropriate SQL. - * - * @param InExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkInExpression($inExpr) {} + public function walkInExpression($inExpr) + { + } /** - * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL. - * - * @param InstanceOfExpression - * @return string The SQL. + * {@inheritdoc} */ - function walkInstanceOfExpression($instanceOfExpr) {} + function walkInstanceOfExpression($instanceOfExpr) + { + } /** - * Walks down a literal that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ - public function walkLiteral($literal) {} + public function walkLiteral($literal) + { + } /** - * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL. - * - * @param BetweenExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkBetweenExpression($betweenExpr) {} + public function walkBetweenExpression($betweenExpr) + { + } /** - * Walks down a LikeExpression AST node, thereby generating the appropriate SQL. - * - * @param LikeExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkLikeExpression($likeExpr) {} + public function walkLikeExpression($likeExpr) + { + } /** - * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL. - * - * @param StateFieldPathExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkStateFieldPathExpression($stateFieldPathExpression) {} + public function walkStateFieldPathExpression($stateFieldPathExpression) + { + } /** - * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param ComparisonExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkComparisonExpression($compExpr) {} + public function walkComparisonExpression($compExpr) + { + } /** - * Walks down an InputParameter AST node, thereby generating the appropriate SQL. - * - * @param InputParameter - * @return string The SQL. + * {@inheritdoc} */ - public function walkInputParameter($inputParam) {} + public function walkInputParameter($inputParam) + { + } /** - * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param ArithmeticExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkArithmeticExpression($arithmeticExpr) {} + public function walkArithmeticExpression($arithmeticExpr) + { + } /** - * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ - public function walkArithmeticTerm($term) {} + public function walkArithmeticTerm($term) + { + } /** - * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ - public function walkStringPrimary($stringPrimary) {} + public function walkStringPrimary($stringPrimary) + { + } /** - * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ - public function walkArithmeticFactor($factor) {} + public function walkArithmeticFactor($factor) + { + } /** - * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleArithmeticExpression - * @return string The SQL. + * {@inheritdoc} */ - public function walkSimpleArithmeticExpression($simpleArithmeticExpr) {} + public function walkSimpleArithmeticExpression($simpleArithmeticExpr) + { + } /** - * Walks down an PathExpression AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ - public function walkPathExpression($pathExpr) {} + public function walkPathExpression($pathExpr) + { + } /** - * Walks down an ResultVariable AST node, thereby generating the appropriate SQL. - * - * @param string $resultVariable - * @return string The SQL. + * {@inheritdoc} */ - public function walkResultVariable($resultVariable) {} + public function walkResultVariable($resultVariable) + { + } /** - * Gets an executor that can be used to execute the result of this walker. - * - * @return AbstractExecutor + * {@inheritdoc} */ - public function getExecutor($AST) {} + public function getExecutor($AST) + { + } } diff --git a/lib/Doctrine/ORM/Query/TreeWalkerChain.php b/lib/Doctrine/ORM/Query/TreeWalkerChain.php index f20413c40..4ce356d84 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerChain.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerChain.php @@ -29,17 +29,36 @@ namespace Doctrine\ORM\Query; */ class TreeWalkerChain implements TreeWalker { - /** The tree walkers. */ + /** + * The tree walkers. + * + * @var TreeWalker[] + */ private $_walkers = array(); - /** The original Query. */ + + /** + * The original Query. + * + * @var \Doctrine\ORM\AbstractQuery + */ private $_query; - /** The ParserResult of the original query that was produced by the Parser. */ + + /** + * The ParserResult of the original query that was produced by the Parser. + * + * @var \Doctrine\ORM\Query\ParserResult + */ private $_parserResult; - /** The query components of the original query (the "symbol table") that was produced by the Parser. */ + + /** + * The query components of the original query (the "symbol table") that was produced by the Parser. + * + * @var array + */ private $_queryComponents; /** - * Return internal queryComponents array + * Returns the internal queryComponents array. * * @return array */ @@ -49,10 +68,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Set or override a query component for a given dql alias. - * - * @param string $dqlAlias The DQL alias. - * @param array $queryComponent + * {@inheritdoc} */ public function setQueryComponent($dqlAlias, array $queryComponent) { @@ -66,7 +82,7 @@ class TreeWalkerChain implements TreeWalker } /** - * @inheritdoc + * {@inheritdoc} */ public function __construct($query, $parserResult, array $queryComponents) { @@ -79,6 +95,8 @@ class TreeWalkerChain implements TreeWalker * Adds a tree walker to the chain. * * @param string $walkerClass The class of the walker to instantiate. + * + * @return void */ public function addTreeWalker($walkerClass) { @@ -86,9 +104,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a SelectStatement AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ public function walkSelectStatement(AST\SelectStatement $AST) { @@ -100,9 +116,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a SelectClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ public function walkSelectClause($selectClause) { @@ -112,9 +126,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a FromClause AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ public function walkFromClause($fromClause) { @@ -124,9 +136,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a FunctionNode AST node, thereby generating the appropriate SQL. - * - * @return string The SQL. + * {@inheritdoc} */ public function walkFunction($function) { @@ -136,10 +146,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an OrderByClause AST node, thereby generating the appropriate SQL. - * - * @param OrderByClause - * @return string The SQL. + * {@inheritdoc} */ public function walkOrderByClause($orderByClause) { @@ -149,10 +156,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an OrderByItem AST node, thereby generating the appropriate SQL. - * - * @param OrderByItem - * @return string The SQL. + * {@inheritdoc} */ public function walkOrderByItem($orderByItem) { @@ -162,10 +166,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a HavingClause AST node, thereby generating the appropriate SQL. - * - * @param HavingClause - * @return string The SQL. + * {@inheritdoc} */ public function walkHavingClause($havingClause) { @@ -175,10 +176,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a Join AST node and creates the corresponding SQL. - * - * @param Join $join - * @return string The SQL. + * {@inheritdoc} */ public function walkJoin($join) { @@ -188,10 +186,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a SelectExpression AST node and generates the corresponding SQL. - * - * @param SelectExpression $selectExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkSelectExpression($selectExpression) { @@ -201,10 +196,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a QuantifiedExpression AST node, thereby generating the appropriate SQL. - * - * @param QuantifiedExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkQuantifiedExpression($qExpr) { @@ -214,10 +206,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a Subselect AST node, thereby generating the appropriate SQL. - * - * @param Subselect - * @return string The SQL. + * {@inheritdoc} */ public function walkSubselect($subselect) { @@ -227,10 +216,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a SubselectFromClause AST node, thereby generating the appropriate SQL. - * - * @param SubselectFromClause - * @return string The SQL. + * {@inheritdoc} */ public function walkSubselectFromClause($subselectFromClause) { @@ -240,10 +226,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a SimpleSelectClause AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectClause - * @return string The SQL. + * {@inheritdoc} */ public function walkSimpleSelectClause($simpleSelectClause) { @@ -253,10 +236,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a SimpleSelectExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleSelectExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkSimpleSelectExpression($simpleSelectExpression) { @@ -266,10 +246,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an AggregateExpression AST node, thereby generating the appropriate SQL. - * - * @param AggregateExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkAggregateExpression($aggExpression) { @@ -279,10 +256,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a GroupByClause AST node, thereby generating the appropriate SQL. - * - * @param GroupByClause - * @return string The SQL. + * {@inheritdoc} */ public function walkGroupByClause($groupByClause) { @@ -292,10 +266,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a GroupByItem AST node, thereby generating the appropriate SQL. - * - * @param GroupByItem - * @return string The SQL. + * {@inheritdoc} */ public function walkGroupByItem($groupByItem) { @@ -305,10 +276,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an UpdateStatement AST node, thereby generating the appropriate SQL. - * - * @param UpdateStatement - * @return string The SQL. + * {@inheritdoc} */ public function walkUpdateStatement(AST\UpdateStatement $AST) { @@ -318,10 +286,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a DeleteStatement AST node, thereby generating the appropriate SQL. - * - * @param DeleteStatement - * @return string The SQL. + * {@inheritdoc} */ public function walkDeleteStatement(AST\DeleteStatement $AST) { @@ -331,10 +296,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a DeleteClause AST node, thereby generating the appropriate SQL. - * - * @param DeleteClause - * @return string The SQL. + * {@inheritdoc} */ public function walkDeleteClause(AST\DeleteClause $deleteClause) { @@ -344,10 +306,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an UpdateClause AST node, thereby generating the appropriate SQL. - * - * @param UpdateClause - * @return string The SQL. + * {@inheritdoc} */ public function walkUpdateClause($updateClause) { @@ -357,10 +316,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an UpdateItem AST node, thereby generating the appropriate SQL. - * - * @param UpdateItem - * @return string The SQL. + * {@inheritdoc} */ public function walkUpdateItem($updateItem) { @@ -370,10 +326,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a WhereClause AST node, thereby generating the appropriate SQL. - * - * @param WhereClause - * @return string The SQL. + * {@inheritdoc} */ public function walkWhereClause($whereClause) { @@ -383,10 +336,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a ConditionalExpression AST node, thereby generating the appropriate SQL. - * - * @param ConditionalExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkConditionalExpression($condExpr) { @@ -396,10 +346,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a ConditionalTerm AST node, thereby generating the appropriate SQL. - * - * @param ConditionalTerm - * @return string The SQL. + * {@inheritdoc} */ public function walkConditionalTerm($condTerm) { @@ -409,10 +356,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a ConditionalFactor AST node, thereby generating the appropriate SQL. - * - * @param ConditionalFactor - * @return string The SQL. + * {@inheritdoc} */ public function walkConditionalFactor($factor) { @@ -422,10 +366,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a ConditionalPrimary AST node, thereby generating the appropriate SQL. - * - * @param ConditionalPrimary - * @return string The SQL. + * {@inheritdoc} */ public function walkConditionalPrimary($condPrimary) { @@ -435,10 +376,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an ExistsExpression AST node, thereby generating the appropriate SQL. - * - * @param ExistsExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkExistsExpression($existsExpr) { @@ -448,10 +386,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a CollectionMemberExpression AST node, thereby generating the appropriate SQL. - * - * @param CollectionMemberExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkCollectionMemberExpression($collMemberExpr) { @@ -461,10 +396,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an EmptyCollectionComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param EmptyCollectionComparisonExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) { @@ -474,10 +406,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a NullComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param NullComparisonExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkNullComparisonExpression($nullCompExpr) { @@ -487,10 +416,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an InExpression AST node, thereby generating the appropriate SQL. - * - * @param InExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkInExpression($inExpr) { @@ -500,10 +426,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an InstanceOfExpression AST node, thereby generating the appropriate SQL. - * - * @param InstanceOfExpression - * @return string The SQL. + * {@inheritdoc} */ function walkInstanceOfExpression($instanceOfExpr) { @@ -513,10 +436,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a literal that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkLiteral($literal) { @@ -526,10 +446,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a BetweenExpression AST node, thereby generating the appropriate SQL. - * - * @param BetweenExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkBetweenExpression($betweenExpr) { @@ -539,10 +456,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a LikeExpression AST node, thereby generating the appropriate SQL. - * - * @param LikeExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkLikeExpression($likeExpr) { @@ -552,10 +466,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a StateFieldPathExpression AST node, thereby generating the appropriate SQL. - * - * @param StateFieldPathExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkStateFieldPathExpression($stateFieldPathExpression) { @@ -565,10 +476,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a ComparisonExpression AST node, thereby generating the appropriate SQL. - * - * @param ComparisonExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkComparisonExpression($compExpr) { @@ -578,10 +486,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an InputParameter AST node, thereby generating the appropriate SQL. - * - * @param InputParameter - * @return string The SQL. + * {@inheritdoc} */ public function walkInputParameter($inputParam) { @@ -591,10 +496,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an ArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param ArithmeticExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkArithmeticExpression($arithmeticExpr) { @@ -604,10 +506,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an ArithmeticTerm AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkArithmeticTerm($term) { @@ -617,10 +516,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down a StringPrimary that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkStringPrimary($stringPrimary) { @@ -630,10 +526,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an ArithmeticFactor that represents an AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkArithmeticFactor($factor) { @@ -643,10 +536,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an SimpleArithmeticExpression AST node, thereby generating the appropriate SQL. - * - * @param SimpleArithmeticExpression - * @return string The SQL. + * {@inheritdoc} */ public function walkSimpleArithmeticExpression($simpleArithmeticExpr) { @@ -656,10 +546,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an PathExpression AST node, thereby generating the appropriate SQL. - * - * @param mixed - * @return string The SQL. + * {@inheritdoc} */ public function walkPathExpression($pathExpr) { @@ -669,10 +556,7 @@ class TreeWalkerChain implements TreeWalker } /** - * Walks down an ResultVariable AST node, thereby generating the appropriate SQL. - * - * @param string $resultVariable - * @return string The SQL. + * {@inheritdoc} */ public function walkResultVariable($resultVariable) { @@ -682,10 +566,9 @@ class TreeWalkerChain implements TreeWalker } /** - * Gets an executor that can be used to execute the result of this walker. - * - * @return AbstractExecutor + * {@inheritdoc} */ public function getExecutor($AST) - {} + { + } }