Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
33fc28ff
Commit
33fc28ff
authored
Aug 06, 2009
by
guilhermeblanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Updated AST nodes to use public properties instead of setter/getter methods.
parent
f087a005
Changes
64
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
64 changed files
with
1835 additions
and
1821 deletions
+1835
-1821
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+8
-3
AbstractQuery.php
lib/Doctrine/ORM/AbstractQuery.php
+2
-0
ArithmeticFactor.php
lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php
+39
-18
ArithmeticTerm.php
lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php
+27
-11
BetweenExpression.php
lib/Doctrine/ORM/Query/AST/BetweenExpression.php
+33
-37
CollectionMemberExpression.php
lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php
+29
-5
ComparisonExpression.php
lib/Doctrine/ORM/Query/AST/ComparisonExpression.php
+13
-22
ComparisonOperator.php
lib/Doctrine/ORM/Query/AST/ComparisonOperator.php
+0
-42
ConditionalExpression.php
lib/Doctrine/ORM/Query/AST/ConditionalExpression.php
+27
-11
ConditionalFactor.php
lib/Doctrine/ORM/Query/AST/ConditionalFactor.php
+29
-19
ConditionalPrimary.php
lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php
+29
-28
ConditionalTerm.php
lib/Doctrine/ORM/Query/AST/ConditionalTerm.php
+27
-11
DeleteClause.php
lib/Doctrine/ORM/Query/AST/DeleteClause.php
+11
-18
DeleteStatement.php
lib/Doctrine/ORM/Query/AST/DeleteStatement.php
+10
-23
EmptyCollectionComparisonExpression.php
...ine/ORM/Query/AST/EmptyCollectionComparisonExpression.php
+30
-20
ExistsExpression.php
lib/Doctrine/ORM/Query/AST/ExistsExpression.php
+28
-22
FromClause.php
lib/Doctrine/ORM/Query/AST/FromClause.php
+10
-14
AbsFunction.php
lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php
+30
-13
ConcatFunction.php
lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php
+31
-20
CurrentDateFunction.php
lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php
+27
-2
CurrentTimeFunction.php
lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php
+25
-4
FunctionNode.php
lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php
+10
-9
LengthFunction.php
lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php
+31
-12
LocateFunction.php
lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php
+44
-34
LowerFunction.php
lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php
+31
-12
ModFunction.php
lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php
+39
-23
SizeFunction.php
lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php
+14
-15
SqrtFunction.php
lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php
+31
-12
SubstringFunction.php
lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php
+42
-33
TrimFunction.php
lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php
+51
-67
UpperFunction.php
lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php
+31
-12
GroupByClause.php
lib/Doctrine/ORM/Query/AST/GroupByClause.php
+27
-11
HavingClause.php
lib/Doctrine/ORM/Query/AST/HavingClause.php
+27
-11
IdentificationVariableDeclaration.php
...trine/ORM/Query/AST/IdentificationVariableDeclaration.php
+13
-31
InExpression.php
lib/Doctrine/ORM/Query/AST/InExpression.php
+30
-44
IndexBy.php
lib/Doctrine/ORM/Query/AST/IndexBy.php
+9
-13
InputParameter.php
lib/Doctrine/ORM/Query/AST/InputParameter.php
+29
-33
Join.php
lib/Doctrine/ORM/Query/AST/Join.php
+15
-51
JoinAssociationPathExpression.php
lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php
+32
-18
JoinVariableDeclaration.php
lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php
+11
-20
LikeExpression.php
lib/Doctrine/ORM/Query/AST/LikeExpression.php
+33
-33
Node.php
lib/Doctrine/ORM/Query/AST/Node.php
+7
-7
NullComparisonExpression.php
lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php
+29
-23
OrderByClause.php
lib/Doctrine/ORM/Query/AST/OrderByClause.php
+27
-11
OrderByItem.php
lib/Doctrine/ORM/Query/AST/OrderByItem.php
+14
-28
PathExpression.php
lib/Doctrine/ORM/Query/AST/PathExpression.php
+35
-53
QuantifiedExpression.php
lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php
+31
-27
RangeVariableDeclaration.php
lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php
+13
-27
SelectClause.php
lib/Doctrine/ORM/Query/AST/SelectClause.php
+11
-38
SelectExpression.php
lib/Doctrine/ORM/Query/AST/SelectExpression.php
+11
-20
SelectStatement.php
lib/Doctrine/ORM/Query/AST/SelectStatement.php
+17
-51
SimpleArithmeticExpression.php
lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php
+27
-11
SimpleSelectClause.php
lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php
+12
-25
SimpleSelectExpression.php
lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php
+11
-24
Subselect.php
lib/Doctrine/ORM/Query/AST/Subselect.php
+15
-64
SubselectFromClause.php
lib/Doctrine/ORM/Query/AST/SubselectFromClause.php
+9
-13
UpdateClause.php
lib/Doctrine/ORM/Query/AST/UpdateClause.php
+31
-28
UpdateItem.php
lib/Doctrine/ORM/Query/AST/UpdateItem.php
+12
-27
UpdateStatement.php
lib/Doctrine/ORM/Query/AST/UpdateStatement.php
+10
-23
WhereClause.php
lib/Doctrine/ORM/Query/AST/WhereClause.php
+28
-12
MultiTableDeleteExecutor.php
lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php
+4
-4
MultiTableUpdateExecutor.php
lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php
+14
-11
Parser.php
lib/Doctrine/ORM/Query/Parser.php
+119
-125
SqlWalker.php
lib/Doctrine/ORM/Query/SqlWalker.php
+333
-332
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
33fc28ff
...
...
@@ -30,7 +30,12 @@ use Doctrine\DBAL\Types;
* point of abstraction of platform-specific behaviors, features and SQL dialects.
* They are a passive source of information.
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
*/
...
...
lib/Doctrine/ORM/AbstractQuery.php
View file @
33fc28ff
...
...
@@ -21,6 +21,8 @@
namespace
Doctrine\ORM
;
use
Doctrine\ORM\Query\QueryException
;
/**
* Base class for Query and NativeQuery.
*
...
...
lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,34 +24,40 @@ namespace Doctrine\ORM\Query\AST;
/**
* ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ArithmeticFactor
extends
Node
{
private
$_arithmeticPrimary
;
private
$_pSigned
;
private
$_nSigned
;
/**
* @var ArithmeticPrimary
*/
public
$arithmeticPrimary
;
public
function
__construct
(
$arithmeticPrimary
,
$pSigned
=
false
,
$nSigned
=
false
)
{
$this
->
_arithmeticPrimary
=
$arithmeticPrimary
;
$this
->
_pSigned
=
$pSigned
;
$this
->
_nSigned
=
$nSigned
;
}
/**
* @var null|boolean NULL represents no sign, TRUE means positive and FALSE means negative sign
*/
public
$sign
;
public
function
getArithmeticPrimary
(
)
public
function
__construct
(
$arithmeticPrimary
,
$sign
=
null
)
{
return
$this
->
_arithmeticPrimary
;
$this
->
arithmeticPrimary
=
$arithmeticPrimary
;
$this
->
sign
=
$sign
;
}
public
function
isPositiveSigned
()
{
return
$this
->
_pSigned
;
return
$this
->
sign
===
true
;
}
public
function
isNegativeSigned
()
{
return
$this
->
_nSigned
;
return
$this
->
sign
===
false
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}*
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ArithmeticTerm
extends
Node
{
p
rivate
$_f
actors
;
p
ublic
$arithmeticF
actors
;
public
function
__construct
(
array
$arithmeticFactors
)
{
$this
->
_factors
=
$arithmeticFactors
;
}
public
function
getArithmeticFactors
()
{
return
$this
->
_factors
;
$this
->
arithmeticFactors
=
$arithmeticFactors
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/BetweenExpression.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,45 +24,26 @@ namespace Doctrine\ORM\Query\AST;
/**
* Description of BetweenExpression
*
* @author robo
@license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
BetweenExpression
extends
Node
{
private
$_baseExpression
;
private
$_leftBetweenExpression
;
private
$_rightBetweenExpression
;
private
$_not
;
public
function
__construct
(
$baseExpr
,
$leftExpr
,
$rightExpr
)
{
$this
->
_baseExpression
=
$baseExpr
;
$this
->
_leftBetweenExpression
=
$leftExpr
;
$this
->
_rightBetweenExpression
=
$rightExpr
;
}
public
function
getBaseExpression
()
{
return
$this
->
_baseExpression
;
}
public
function
getLeftBetweenExpression
()
{
return
$this
->
_leftBetweenExpression
;
}
public
function
getRightBetweenExpression
()
{
return
$this
->
_rightBetweenExpression
;
}
public
function
setNot
(
$bool
)
{
$this
->
_not
=
$bool
;
}
public
$expression
;
public
$leftBetweenExpression
;
public
$rightBetweenExpression
;
public
$not
;
public
function
getNot
(
)
public
function
__construct
(
$expr
,
$leftExpr
,
$rightExpr
)
{
return
$this
->
_not
;
$this
->
expression
=
$expr
;
$this
->
leftBetweenExpression
=
$leftExpr
;
$this
->
rightBetweenExpression
=
$rightExpr
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php
View file @
33fc28ff
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
/**
* CollectionMemberExpression ::= EntityExpression ["NOT"] "MEMBER" ["OF"] CollectionValuedPathExpression
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
CollectionMemberExpression
extends
Node
{
public
$entityExpression
;
public
$collectionValuedPathExpression
;
public
$
isN
ot
;
public
$
n
ot
;
public
function
__construct
(
$entityExpr
,
$collValuedPathExpr
,
$isNot
)
public
function
__construct
(
$entityExpr
,
$collValuedPathExpr
)
{
$this
->
entityExpression
=
$entityExpr
;
$this
->
collectionValuedPathExpression
=
$collValuedPathExpr
;
$this
->
isNot
=
$isNot
;
}
public
function
dispatch
(
$walker
)
...
...
lib/Doctrine/ORM/Query/AST/ComparisonExpression.php
View file @
33fc28ff
...
...
@@ -29,34 +29,25 @@ namespace Doctrine\ORM\Query\AST;
* DatetimeExpression ComparisonOperator (DatetimeExpression | QuantifiedExpression) |
* EntityExpression ("=" | "<>") (EntityExpression | QuantifiedExpression)
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ComparisonExpression
extends
Node
{
p
rivate
$_leftExpr
;
p
rivate
$_rightExpr
;
p
rivate
$_
operator
;
p
ublic
$leftExpression
;
p
ublic
$rightExpression
;
p
ublic
$
operator
;
public
function
__construct
(
$leftExpr
,
$operator
,
$rightExpr
)
{
$this
->
_leftExpr
=
$leftExpr
;
$this
->
_rightExpr
=
$rightExpr
;
$this
->
_operator
=
$operator
;
}
public
function
getLeftExpression
()
{
return
$this
->
_leftExpr
;
}
public
function
getRightExpression
()
{
return
$this
->
_rightExpr
;
}
public
function
getOperator
()
{
return
$this
->
_operator
;
$this
->
leftExpression
=
$leftExpr
;
$this
->
rightExpression
=
$rightExpr
;
$this
->
operator
=
$operator
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ComparisonOperator.php
deleted
100644 → 0
View file @
f087a005
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
/**
* ComparisonOperator = "=" | "<" | "<=" | "<>" | ">" | ">=" | "!="
*
* @package Doctrine
* @subpackage Query
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Janne Vanhala <jpvanhal@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link http://www.phpdoctrine.org
* @since 2.0
* @version $Revision$
*/
class
ComparisonOperator
extends
Node
{
public
function
dispatch
(
$sqlWalker
)
{
;
}
}
\ No newline at end of file
lib/Doctrine/ORM/Query/AST/ConditionalExpression.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ConditionalExpression
extends
Node
{
p
rivate
$_
conditionalTerms
=
array
();
p
ublic
$
conditionalTerms
=
array
();
public
function
__construct
(
array
$conditionalTerms
)
{
$this
->
_conditionalTerms
=
$conditionalTerms
;
}
public
function
getConditionalTerms
()
{
return
$this
->
_conditionalTerms
;
$this
->
conditionalTerms
=
$conditionalTerms
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ConditionalFactor.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,27 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
* ConditionalFactor ::= ["NOT"] ConditionalPrimary
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ConditionalFactor
extends
Node
{
private
$_not
=
false
;
private
$_conditionalPrimary
;
public
function
__construct
(
$conditionalPrimary
,
$not
=
false
)
{
$this
->
_conditionalPrimary
=
$conditionalPrimary
;
$this
->
_not
=
$not
;
}
public
function
isNot
()
{
return
$this
->
_not
;
}
public
$not
=
false
;
public
$conditionalPrimary
;
public
function
getConditionalPrimary
(
)
public
function
__construct
(
$conditionalPrimary
)
{
return
$this
->
_
conditionalPrimary
;
$this
->
conditionalPrimary
=
$
conditionalPrimary
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,41 +24,27 @@ namespace Doctrine\ORM\Query\AST;
/**
* ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ConditionalPrimary
extends
Node
{
private
$_simpleConditionalExpression
;
private
$_conditionalExpression
;
public
function
setSimpleConditionalExpression
(
$simpleConditionalExpr
)
{
$this
->
_simpleConditionalExpression
=
$simpleConditionalExpr
;
}
public
function
setConditionalExpression
(
$conditionalExpr
)
{
$this
->
_conditionalExpression
=
$conditionalExpr
;
}
public
function
getSimpleConditionalExpression
()
{
return
$this
->
_simpleConditionalExpression
;
}
public
function
getConditionalExpression
()
{
return
$this
->
_conditionalExpression
;
}
public
$simpleConditionalExpression
;
public
$conditionalExpression
;
public
function
isSimpleConditionalExpression
()
{
return
(
bool
)
$this
->
_
simpleConditionalExpression
;
return
(
bool
)
$this
->
simpleConditionalExpression
;
}
public
function
isConditionalExpression
()
{
return
(
bool
)
$this
->
_
conditionalExpression
;
return
(
bool
)
$this
->
conditionalExpression
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ConditionalTerm.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ConditionalTerm
extends
Node
{
p
rivate
$_
conditionalFactors
=
array
();
p
ublic
$
conditionalFactors
=
array
();
public
function
__construct
(
array
$conditionalFactors
)
{
$this
->
_conditionalFactors
=
$conditionalFactors
;
}
public
function
getConditionalFactors
()
{
return
$this
->
_conditionalFactors
;
$this
->
conditionalFactors
=
$conditionalFactors
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/DeleteClause.php
View file @
33fc28ff
...
...
@@ -23,30 +23,23 @@ namespace Doctrine\ORM\Query\AST;
/**
* DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName [["AS"] AliasIdentificationVariable]
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
DeleteClause
extends
Node
{
p
rivate
$_
abstractSchemaName
;
p
rivate
$_
aliasIdentificationVariable
;
p
ublic
$
abstractSchemaName
;
p
ublic
$
aliasIdentificationVariable
;
public
function
__construct
(
$abstractSchemaName
)
{
$this
->
_abstractSchemaName
=
$abstractSchemaName
;
}
public
function
getAbstractSchemaName
()
{
return
$this
->
_abstractSchemaName
;
}
public
function
getAliasIdentificationVariable
()
{
return
$this
->
_aliasIdentificationVariable
;
}
public
function
setAliasIdentificationVariable
(
$alias
)
{
$this
->
_aliasIdentificationVariable
=
$alias
;
$this
->
abstractSchemaName
=
$abstractSchemaName
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/DeleteStatement.php
View file @
33fc28ff
...
...
@@ -24,35 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
* DeleteStatement = DeleteClause [WhereClause]
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
DeleteStatement
extends
Node
{
p
rivate
$_
deleteClause
;
p
rivate
$_
whereClause
;
p
ublic
$
deleteClause
;
p
ublic
$
whereClause
;
public
function
__construct
(
$deleteClause
)
{
$this
->
_deleteClause
=
$deleteClause
;
}
public
function
setWhereClause
(
$whereClause
)
{
$this
->
_whereClause
=
$whereClause
;
}
public
function
getDeleteClause
()
{
return
$this
->
_deleteClause
;
}
public
function
getWhereClause
()
{
return
$this
->
_whereClause
;
$this
->
deleteClause
=
$deleteClause
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php
View file @
33fc28ff
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
/**
* EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY"
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
EmptyCollectionComparisonExpression
extends
Node
{
p
rivate
$_
expression
;
p
rivate
$_
not
;
p
ublic
$
expression
;
p
ublic
$
not
;
public
function
__construct
(
$expression
)
{
$this
->
_expression
=
$expression
;
}
public
function
getExpression
()
{
return
$this
->
_expression
;
}
public
function
setNot
(
$bool
)
{
$this
->
_not
=
$bool
;
}
public
function
isNot
()
{
return
$this
->
_not
;
$this
->
expression
=
$expression
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ExistsExpression.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,31 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
* ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ExistsExpression
extends
Node
{
p
rivate
$_not
=
false
;
p
rivate
$_
subselect
;
p
ublic
$not
;
p
ublic
$
subselect
;
public
function
__construct
(
$subselect
)
{
$this
->
_subselect
=
$subselect
;
}
public
function
setNot
(
$bool
)
{
$this
->
_not
=
$bool
;
}
public
function
isNot
()
{
return
$this
->
_not
;
}
public
function
getSubselect
()
{
return
$this
->
_subselect
;
$this
->
subselect
=
$subselect
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/FromClause.php
View file @
33fc28ff
...
...
@@ -16,7 +16,7 @@
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.
phpdoctrine
.org>.
* <http://www.
doctrine-project
.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -24,25 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
FromClause
extends
Node
{
p
rotected
$_
identificationVariableDeclarations
=
array
();
p
ublic
$
identificationVariableDeclarations
=
array
();
public
function
__construct
(
array
$identificationVariableDeclarations
)
{
$this
->
_identificationVariableDeclarations
=
$identificationVariableDeclarations
;
}
/* Getters */
public
function
getIdentificationVariableDeclarations
()
{
return
$this
->
_identificationVariableDeclarations
;
$this
->
identificationVariableDeclarations
=
$identificationVariableDeclarations
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,24 +24,26 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "ABS" "(" SimpleArithmeticExpression ")"
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
AbsFunction
extends
FunctionNode
{
private
$_simpleArithmeticExpression
;
public
function
getSimpleArithmeticExpression
()
{
return
$this
->
_simpleArithmeticExpression
;
}
public
$simpleArithmeticExpression
;
/**
* @override
*/
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
//TODO: Use platform to get SQL
return
'ABS('
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_simpleArithmeticExpression
)
.
')'
;
return
'ABS('
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
simpleArithmeticExpression
)
.
')'
;
}
/**
...
...
@@ -37,7 +54,7 @@ class AbsFunction extends FunctionNode
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_
simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,22 +24,18 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "CONCAT" "(" StringPrimary "," StringPrimary ")"
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ConcatFunction
extends
FunctionNode
{
private
$_firstStringPrimary
;
private
$_secondStringPriamry
;
public
function
getFirstStringPrimary
()
{
return
$this
->
_firstStringPrimary
;
}
public
function
getSecondStringPrimary
()
{
return
$this
->
_secondStringPrimary
;
}
public
$firstStringPrimary
;
public
$secondStringPriamry
;
/**
* @override
...
...
@@ -33,8 +44,8 @@ class ConcatFunction extends FunctionNode
{
$platform
=
$sqlWalker
->
getConnection
()
->
getDatabasePlatform
();
return
$platform
->
getConcatExpression
(
$sqlWalker
->
walkStringPrimary
(
$this
->
_
firstStringPrimary
),
$sqlWalker
->
walkStringPrimary
(
$this
->
_
secondStringPrimary
)
$sqlWalker
->
walkStringPrimary
(
$this
->
firstStringPrimary
),
$sqlWalker
->
walkStringPrimary
(
$this
->
secondStringPrimary
)
);
}
...
...
@@ -47,9 +58,9 @@ class ConcatFunction extends FunctionNode
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_
firstStringPrimary
=
$parser
->
StringPrimary
();
$this
->
firstStringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
','
);
$this
->
_
secondStringPrimary
=
$parser
->
StringPrimary
();
$this
->
secondStringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php
View file @
33fc28ff
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
/**
* "CURRENT_DATE"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
CurrentDateFunction
extends
FunctionNode
{
...
...
lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,7 +24,13 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "CURRENT_TIME"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
CurrentTimeFunction
extends
FunctionNode
{
...
...
lib/Doctrine/ORM/Query/AST/Functions/FunctionNode.php
View file @
33fc28ff
...
...
@@ -24,22 +24,23 @@ namespace Doctrine\ORM\Query\AST\Functions;
use
Doctrine\ORM\Query\AST\Node
;
/**
*
Description of Function
*
Abtract Function Node.
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
abstract
class
FunctionNode
extends
Node
{
p
rivate
$_
name
;
p
ublic
$
name
;
public
function
__construct
(
$name
)
{
$this
->
_name
=
$name
;
}
public
function
getName
()
{
return
$this
->
_name
;
$this
->
name
=
$name
;
}
abstract
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
);
...
...
lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "LENGTH" "(" StringPrimary ")"
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
LengthFunction
extends
FunctionNode
{
private
$_stringPrimary
;
public
function
getStringPrimary
()
{
return
$this
->
_stringPrimary
;
}
public
$stringPrimary
;
/**
* @override
...
...
@@ -26,7 +42,7 @@ class LengthFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
//TODO: Use platform to get SQL
return
'LENGTH('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
_
stringPrimary
)
.
')'
;
return
'LENGTH('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
stringPrimary
)
.
')'
;
}
/**
...
...
@@ -35,9 +51,12 @@ class LengthFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,28 +24,19 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "LOCATE" "(" StringPrimary "," StringPrimary ["," SimpleArithmeticExpression]")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
LocateFunction
extends
FunctionNode
{
private
$_firstStringPrimary
;
private
$_secondStringPrimary
;
private
$_simpleArithmeticExpression
;
public
function
getFirstStringPrimary
()
{
return
$this
->
_firstStringPrimary
;
}
public
function
getSecondStringPrimary
()
{
return
$this
->
_secondStringPrimary
;
}
public
function
getSimpleArithmeticExpression
()
{
return
$this
->
_simpleArithmeticExpression
;
}
public
$firstStringPrimary
;
public
$secondStringPrimary
;
public
$simpleArithmeticExpression
;
/**
* @override
...
...
@@ -38,15 +44,12 @@ class LocateFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
//TODO: Use platform to get SQL
$sql
=
'LOCATE('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
_firstStringPrimary
)
.
', '
.
$sqlWalker
->
walkStringPrimary
(
$this
->
_secondStringPrimary
);
if
(
$this
->
_simpleArithmeticExpression
)
{
$sql
.=
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_simpleArithmeticExpression
);
}
return
$sql
.
')'
;
return
'LOCATE('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
firstStringPrimary
)
.
', '
.
$sqlWalker
->
walkStringPrimary
(
$this
->
secondStringPrimary
)
.
((
$this
->
simpleArithmeticExpression
)
?
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
simpleArithmeticExpression
)
:
''
)
.
')'
;
}
/**
...
...
@@ -55,15 +58,22 @@ class LocateFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_firstStringPrimary
=
$parser
->
StringPrimary
();
$this
->
firstStringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
','
);
$this
->
_secondStringPrimary
=
$parser
->
StringPrimary
();
$this
->
secondStringPrimary
=
$parser
->
StringPrimary
();
if
(
$lexer
->
isNextToken
(
','
))
{
$parser
->
match
(
','
);
$this
->
_simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
}
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "LOWER" "(" StringPrimary ")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
LowerFunction
extends
FunctionNode
{
private
$_stringPrimary
;
public
function
getStringPrimary
()
{
return
$this
->
_stringPrimary
;
}
public
$stringPrimary
;
/**
* @override
...
...
@@ -26,7 +42,7 @@ class LowerFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
//TODO: Use platform to get SQL
return
'LOWER('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
_
stringPrimary
)
.
')'
;
return
'LOWER('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
stringPrimary
)
.
')'
;
}
/**
...
...
@@ -35,9 +51,12 @@ class LowerFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,22 +24,18 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
ModFunction
extends
FunctionNode
{
private
$_firstSimpleArithmeticExpression
;
private
$_secondSimpleArithmeticExpression
;
public
function
getFirstSimpleArithmeticExpression
()
{
return
$this
->
_firstSimpleArithmeticExpression
;
}
public
function
getSecondSimpleArithmeticExpression
()
{
return
$this
->
_secondSimpleArithmeticExpression
;
}
public
$firstSimpleArithmeticExpression
;
public
$secondSimpleArithmeticExpression
;
/**
* @override
...
...
@@ -32,10 +43,10 @@ class ModFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
//TODO: Use platform to get SQL
return
'SQRT('
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_firstSimpleArithmeticExpression
)
.
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_secondSimpleArithmeticExpression
)
return
'SQRT('
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_firstSimpleArithmeticExpression
)
.
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_secondSimpleArithmeticExpression
)
.
')'
;
}
...
...
@@ -45,11 +56,16 @@ class ModFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_firstSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
firstSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
','
);
$this
->
_secondSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
secondSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php
View file @
33fc28ff
...
...
@@ -24,30 +24,26 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "SIZE" "(" CollectionValuedPathExpression ")"
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SizeFunction
extends
FunctionNode
{
private
$_collectionPathExpression
;
public
function
getCollectionPathExpression
()
{
return
$this
->
_collectionPathExpression
;
}
public
function
setCollectionPathExpression
(
$collPathExpr
)
{
$this
->
_collectionPathExpression
=
$collPathExpr
;
}
public
$collectionPathExpression
;
/**
* @override
*/
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
$dqlAlias
=
$this
->
_collectionPathExpression
->
getIdentificationVariable
()
;
$dqlAlias
=
$this
->
collectionPathExpression
->
identificationVariable
;
$qComp
=
$sqlWalker
->
getQueryComponent
(
$dqlAlias
);
$parts
=
$this
->
_collectionPathExpression
->
getParts
()
;
$parts
=
$this
->
collectionPathExpression
->
parts
;
$assoc
=
$qComp
[
'metadata'
]
->
associationMappings
[
$parts
[
0
]];
...
...
@@ -80,9 +76,12 @@ class SizeFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_collectionPathExpression
=
$parser
->
CollectionValuedPathExpression
();
$this
->
collectionPathExpression
=
$parser
->
CollectionValuedPathExpression
();
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "SQRT" "(" SimpleArithmeticExpression ")"
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SqrtFunction
extends
FunctionNode
{
private
$_simpleArithmeticExpression
;
public
function
getSimpleArithmeticExpression
()
{
return
$this
->
_simpleArithmeticExpression
;
}
public
$simpleArithmeticExpression
;
/**
* @override
...
...
@@ -26,7 +42,7 @@ class SqrtFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
//TODO: Use platform to get SQL
return
'SQRT('
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_
simpleArithmeticExpression
)
.
')'
;
return
'SQRT('
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
simpleArithmeticExpression
)
.
')'
;
}
/**
...
...
@@ -35,9 +51,12 @@ class SqrtFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,28 +24,19 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "SUBSTRING" "(" StringPrimary "," SimpleArithmeticExpression "," SimpleArithmeticExpression ")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SubstringFunction
extends
FunctionNode
{
private
$_stringPrimary
;
private
$_firstSimpleArithmeticExpression
;
private
$_secondSimpleArithmeticExpression
;
public
function
geStringPrimary
()
{
return
$this
->
_stringPrimary
;
}
public
function
getSecondSimpleArithmeticExpression
()
{
return
$this
->
_secondSimpleArithmeticExpression
;
}
public
function
getFirstSimpleArithmeticExpression
()
{
return
$this
->
_firstSimpleArithmeticExpression
;
}
public
$stringPrimary
;
public
$firstSimpleArithmeticExpression
;
public
$secondSimpleArithmeticExpression
;
/**
* @override
...
...
@@ -38,14 +44,13 @@ class SubstringFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
//TODO: Use platform to get SQL
$sql
=
'SUBSTRING('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
_
stringPrimary
)
.
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_
firstSimpleArithmeticExpression
)
.
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_
secondSimpleArithmeticExpression
)
return
'SUBSTRING('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
stringPrimary
)
.
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
firstSimpleArithmeticExpression
)
.
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
secondSimpleArithmeticExpression
)
.
')'
;
return
$sql
;
}
/**
...
...
@@ -54,14 +59,18 @@ class SubstringFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
','
);
$this
->
_firstSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
firstSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
','
);
$this
->
_secondSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
secondSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
')'
);
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -11,60 +26,21 @@ use Doctrine\ORM\Query\Lexer;
/**
* "TRIM" "(" [["LEADING" | "TRAILING" | "BOTH"] [char] "FROM"] StringPrimary ")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
TrimFunction
extends
FunctionNode
{
private
$_leading
;
private
$_trailing
;
private
$_both
;
private
$_trimChar
;
private
$_stringPrimary
;
public
function
getStringPrimary
()
{
return
$this
->
_stringPrimary
;
}
public
function
isLeading
()
{
return
$this
->
_leading
;
}
public
function
setLeading
(
$bool
)
{
$this
->
_leading
=
$bool
;
}
public
function
isTrailing
()
{
return
$this
->
_trailing
;
}
public
function
setTrailing
(
$bool
)
{
$this
->
_trailing
=
$bool
;
}
public
function
isBoth
()
{
return
$this
->
_both
;
}
public
function
setBoth
(
$bool
)
{
$this
->
_both
=
$bool
;
}
public
function
getTrimChar
()
{
return
$this
->
_trimChar
;
}
public
function
setTrimChar
(
$trimChar
)
{
$this
->
_trimChar
=
$trimChar
;
}
public
$leading
;
public
$trailing
;
public
$both
;
public
$trimChar
;
public
$stringPrimary
;
/**
* @override
...
...
@@ -72,13 +48,20 @@ class TrimFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
$sql
=
'TRIM('
;
if
(
$this
->
_leading
)
$sql
.=
'LEADING '
;
else
if
(
$this
->
_trailing
)
$sql
.=
'TRAILING '
;
else
if
(
$this
->
_both
)
$sql
.=
'BOTH '
;
if
(
$this
->
_trimChar
)
$sql
.=
$sqlWalker
->
getConnection
()
->
quote
(
$this
->
_trimChar
)
.
' '
;
$sql
.=
'FROM '
.
$sqlWalker
->
walkStringPrimary
(
$this
->
_stringPrimary
);
$sql
.=
')'
;
return
$sql
;
if
(
$this
->
leading
)
{
$sql
.=
'LEADING '
;
}
else
if
(
$this
->
trailing
)
{
$sql
.=
'TRAILING '
;
}
else
if
(
$this
->
both
)
{
$sql
.=
'BOTH '
;
}
if
(
$this
->
trimChar
)
{
$sql
.=
$sqlWalker
->
getConnection
()
->
quote
(
$this
->
trimChar
)
.
' '
;
}
return
$sql
.
'FROM '
.
$sqlWalker
->
walkStringPrimary
(
$this
->
stringPrimary
)
.
')'
;
}
/**
...
...
@@ -87,30 +70,31 @@ class TrimFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
if
(
strcasecmp
(
'leading'
,
$lexer
->
lookahead
[
'value'
])
===
0
)
{
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$this
->
_
leading
=
true
;
$this
->
leading
=
true
;
}
else
if
(
strcasecmp
(
'trailing'
,
$lexer
->
lookahead
[
'value'
])
===
0
)
{
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$this
->
_
trailing
=
true
;
$this
->
trailing
=
true
;
}
else
if
(
strcasecmp
(
'both'
,
$lexer
->
lookahead
[
'value'
])
===
0
)
{
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$this
->
_
both
=
true
;
$this
->
both
=
true
;
}
if
(
$lexer
->
isNextToken
(
Lexer
::
T_STRING
))
{
$parser
->
match
(
Lexer
::
T_STRING
);
$this
->
_
trimChar
=
$lexer
->
token
[
'value'
];
$this
->
trimChar
=
$lexer
->
token
[
'value'
];
}
if
(
$this
->
_leading
||
$this
->
_trailing
||
$this
->
_both
||
$this
->
_
trimChar
)
{
if
(
$this
->
leading
||
$this
->
trailing
||
$this
->
both
||
$this
->
trimChar
)
{
$parser
->
match
(
Lexer
::
T_FROM
);
}
$this
->
_
stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST\Functions
;
...
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
* "UPPER" "(" StringPrimary ")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
UpperFunction
extends
FunctionNode
{
private
$_stringPrimary
;
public
function
getStringPrimary
()
{
return
$this
->
_stringPrimary
;
}
public
$stringPrimary
;
/**
* @override
...
...
@@ -26,7 +42,7 @@ class UpperFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
//TODO: Use platform to get SQL
return
'UPPER('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
_
stringPrimary
)
.
')'
;
return
'UPPER('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
stringPrimary
)
.
')'
;
}
/**
...
...
@@ -35,9 +51,12 @@ class UpperFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$this
->
_stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/GroupByClause.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* Description of GroupByClause
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
GroupByClause
extends
Node
{
p
rivate
$_
groupByItems
=
array
();
p
ublic
$
groupByItems
=
array
();
public
function
__construct
(
array
$groupByItems
)
{
$this
->
_groupByItems
=
$groupByItems
;
}
public
function
getGroupByItems
()
{
return
$this
->
_groupByItems
;
$this
->
groupByItems
=
$groupByItems
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/HavingClause.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* Description of HavingClause
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
HavingClause
extends
Node
{
p
rivate
$_
conditionalExpression
;
p
ublic
$
conditionalExpression
;
public
function
__construct
(
$conditionalExpression
)
{
$this
->
_conditionalExpression
=
$conditionalExpression
;
}
public
function
getConditionalExpression
()
{
return
$this
->
_conditionalExpression
;
$this
->
conditionalExpression
=
$conditionalExpression
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php
View file @
33fc28ff
...
...
@@ -24,43 +24,25 @@ namespace Doctrine\ORM\Query\AST;
/**
* IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
IdentificationVariableDeclaration
extends
Node
{
protected
$_rangeVariableDeclaration
=
null
;
protected
$_indexBy
=
null
;
protected
$_joinVariableDeclarations
=
array
();
public
$rangeVariableDeclaration
=
null
;
public
$indexBy
=
null
;
public
$joinVariableDeclarations
=
array
();
public
function
__construct
(
$rangeVariableDecl
,
$indexBy
,
array
$joinVariableDecls
)
{
$this
->
_rangeVariableDeclaration
=
$rangeVariableDecl
;
$this
->
_indexBy
=
$indexBy
;
$this
->
_joinVariableDeclarations
=
$joinVariableDecls
;
}
/* Getters */
public
function
getRangeVariableDeclaration
()
{
return
$this
->
_rangeVariableDeclaration
;
}
public
function
getIndexBy
()
{
return
$this
->
_indexBy
;
}
public
function
getJoinVariableDeclarations
()
{
return
$this
->
_joinVariableDeclarations
;
$this
->
rangeVariableDeclaration
=
$rangeVariableDecl
;
$this
->
indexBy
=
$indexBy
;
$this
->
joinVariableDeclarations
=
$joinVariableDecls
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/InExpression.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,53 +24,24 @@ namespace Doctrine\ORM\Query\AST;
/**
* InExpression ::= StateFieldPathExpression ["NOT"] "IN" "(" (Literal {"," Literal}* | Subselect) ")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
InExpression
extends
Node
{
p
rivate
$_pathExpression
;
p
rivate
$_not
=
false
;
p
rivate
$_
literals
=
array
();
p
rivate
$_
subselect
;
p
ublic
$not
;
p
ublic
$pathExpression
;
p
ublic
$
literals
=
array
();
p
ublic
$
subselect
;
public
function
__construct
(
$pathExpression
)
{
$this
->
_pathExpression
=
$pathExpression
;
}
public
function
setLiterals
(
array
$literals
)
{
$this
->
_literals
=
$literals
;
}
public
function
getLiterals
()
{
return
$this
->
_literals
;
}
public
function
setSubselect
(
$subselect
)
{
$this
->
_subselect
=
$subselect
;
}
public
function
getSubselect
()
{
return
$this
->
_subselect
;
}
public
function
setNot
(
$bool
)
{
$this
->
_not
=
$bool
;
}
public
function
isNot
()
{
return
$this
->
_not
;
}
public
function
getPathExpression
()
{
return
$this
->
_pathExpression
;
$this
->
pathExpression
=
$pathExpression
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/IndexBy.php
View file @
33fc28ff
...
...
@@ -24,25 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
IndexBy
extends
Node
{
p
rotected
$_
simpleStateFieldPathExpression
=
null
;
p
ublic
$
simpleStateFieldPathExpression
=
null
;
public
function
__construct
(
$simpleStateFieldPathExpression
)
{
$this
->
_simpleStateFieldPathExpression
=
$simpleStateFieldPathExpression
;
}
/* Getters */
public
function
getSimpleStateFieldPathExpression
()
{
return
$this
->
_simpleStateFieldPathExpression
;
$this
->
simpleStateFieldPathExpression
=
$simpleStateFieldPathExpression
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/InputParameter.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,13 +24,18 @@ namespace Doctrine\ORM\Query\AST;
/**
* Description of InputParameter
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
InputParameter
extends
Node
{
private
$_isNamed
;
private
$_position
;
private
$_name
;
public
$isNamed
;
public
$name
;
public
function
__construct
(
$value
)
{
...
...
@@ -24,32 +44,8 @@ class InputParameter extends Node
}
$param
=
substr
(
$value
,
1
);
$this
->
_isNamed
=
!
is_numeric
(
$param
);
if
(
$this
->
_isNamed
)
{
$this
->
_name
=
$param
;
}
else
{
$this
->
_position
=
$param
;
}
}
public
function
isNamed
()
{
return
$this
->
_isNamed
;
}
public
function
isPositional
()
{
return
!
$this
->
_isNamed
;
}
public
function
getName
()
{
return
$this
->
_name
;
}
public
function
getPosition
()
{
return
$this
->
_position
;
$this
->
isNamed
=
!
is_numeric
(
$param
);
$this
->
name
=
$param
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/Join.php
View file @
33fc28ff
...
...
@@ -25,11 +25,13 @@ namespace Doctrine\ORM\Query\AST;
* Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression
* ["AS"] AliasIdentificationVariable [("ON" | "WITH") ConditionalExpression]
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
Join
extends
Node
{
...
...
@@ -39,55 +41,17 @@ class Join extends Node
const
JOIN_WHERE_ON
=
1
;
const
JOIN_WHERE_WITH
=
2
;
p
rotected
$_
joinType
=
self
::
JOIN_TYPE_INNER
;
p
rotected
$_
joinAssociationPathExpression
=
null
;
p
rotected
$_
aliasIdentificationVariable
=
null
;
p
rotected
$_
whereType
=
self
::
JOIN_WHERE_WITH
;
p
rotected
$_
conditionalExpression
=
null
;
p
ublic
$
joinType
=
self
::
JOIN_TYPE_INNER
;
p
ublic
$
joinAssociationPathExpression
=
null
;
p
ublic
$
aliasIdentificationVariable
=
null
;
p
ublic
$
whereType
=
self
::
JOIN_WHERE_WITH
;
p
ublic
$
conditionalExpression
=
null
;
public
function
__construct
(
$joinType
,
$joinAssocPathExpr
,
$aliasIdentVar
)
{
$this
->
_joinType
=
$joinType
;
$this
->
_joinAssociationPathExpression
=
$joinAssocPathExpr
;
$this
->
_aliasIdentificationVariable
=
$aliasIdentVar
;
}
/* Setters */
public
function
setWhereType
(
$whereType
)
{
$this
->
_whereType
=
$whereType
;
}
public
function
setConditionalExpression
(
$conditionalExpression
)
{
$this
->
_conditionalExpression
=
$conditionalExpression
;
}
/* Getters */
public
function
getJoinType
()
{
return
$this
->
_joinType
;
}
public
function
getJoinAssociationPathExpression
()
{
return
$this
->
_joinAssociationPathExpression
;
}
public
function
getAliasIdentificationVariable
()
{
return
$this
->
_aliasIdentificationVariable
;
}
public
function
getWhereType
()
{
return
$this
->
_whereType
;
}
public
function
getConditionalExpression
()
{
return
$this
->
_conditionalExpression
;
$this
->
joinType
=
$joinType
;
$this
->
joinAssociationPathExpression
=
$joinAssocPathExpr
;
$this
->
aliasIdentificationVariable
=
$aliasIdentVar
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php
View file @
33fc28ff
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
/**
* JoinAssociationPathExpression ::= IdentificationVariable "." (SingleValuedAssociationField | CollectionValuedAssociationField)
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Roman Borschel
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
JoinAssociationPathExpression
extends
Node
{
private
$_identificationVariable
;
private
$_assocField
;
public
function
__construct
(
$identificationVariable
,
$assocField
)
{
$this
->
_identificationVariable
=
$identificationVariable
;
$this
->
_assocField
=
$assocField
;
}
public
function
getIdentificationVariable
()
{
return
$this
->
_identificationVariable
;
}
public
$identificationVariable
;
public
$associationField
;
public
function
getAssociationField
(
)
public
function
__construct
(
$identificationVariable
,
$associationField
)
{
return
$this
->
_assocField
;
$this
->
identificationVariable
=
$identificationVariable
;
$this
->
associationField
=
$associationField
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php
View file @
33fc28ff
...
...
@@ -24,32 +24,23 @@ namespace Doctrine\ORM\Query\AST;
/**
* JoinVariableDeclaration ::= Join [IndexBy]
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
JoinVariableDeclaration
extends
Node
{
p
rotected
$_
join
=
null
;
p
rotected
$_
indexBy
=
null
;
p
ublic
$
join
=
null
;
p
ublic
$
indexBy
=
null
;
public
function
__construct
(
$join
,
$indexBy
)
{
$this
->
_join
=
$join
;
$this
->
_indexBy
=
$indexBy
;
}
/* Getters */
public
function
getJoin
()
{
return
$this
->
_join
;
}
public
function
getIndexBy
()
{
return
$this
->
_indexBy
;
$this
->
join
=
$join
;
$this
->
indexBy
=
$indexBy
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/LikeExpression.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,41 +24,26 @@ namespace Doctrine\ORM\Query\AST;
/**
* LikeExpression ::= StringExpression ["NOT"] "LIKE" string ["ESCAPE" char]
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
LikeExpression
extends
Node
{
private
$_stringExpr
;
private
$_isNot
;
private
$_stringPattern
;
private
$_escapeChar
;
public
function
__construct
(
$stringExpr
,
$stringPattern
,
$isNot
=
false
,
$escapeChar
=
null
)
{
$this
->
_stringExpr
=
$stringExpr
;
$this
->
_stringPattern
=
$stringPattern
;
$this
->
_isNot
=
$isNot
;
$this
->
_escapeChar
=
$escapeChar
;
}
public
function
isNot
()
{
return
$this
->
_isNot
;
}
public
function
getStringExpression
()
{
return
$this
->
_stringExpr
;
}
public
function
getStringPattern
()
{
return
$this
->
_stringPattern
;
}
public
$not
;
public
$stringExpression
;
public
$stringPattern
;
public
$escapeChar
;
public
function
getEscapeChar
(
)
public
function
__construct
(
$stringExpression
,
$stringPattern
,
$escapeChar
=
null
)
{
return
$this
->
_escapeChar
;
$this
->
stringExpression
=
$stringExpression
;
$this
->
stringPattern
=
$stringPattern
;
$this
->
escapeChar
=
$escapeChar
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/Node.php
View file @
33fc28ff
...
...
@@ -24,13 +24,13 @@ namespace Doctrine\ORM\Query\AST;
/**
* Abstract class of an AST node
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Janne Vanhala <jpvanhal@cc.hut.fi>
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
abstract
class
Node
{
...
...
lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,31 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
* NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
NullComparisonExpression
extends
Node
{
p
rivate
$_expression
;
p
rivate
$_not
;
p
ublic
$not
;
p
ublic
$expression
;
public
function
__construct
(
$expression
)
{
$this
->
_expression
=
$expression
;
}
public
function
getExpression
()
{
return
$this
->
_expression
;
}
public
function
setNot
(
$bool
)
{
$this
->
_not
=
$bool
;
}
public
function
isNot
()
{
return
$this
->
_not
;
$this
->
expression
=
$expression
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/OrderByClause.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
OrderByClause
extends
Node
{
p
rivate
$_
orderByItems
=
array
();
p
ublic
$
orderByItems
=
array
();
public
function
__construct
(
array
$orderByItems
)
{
$this
->
_orderByItems
=
$orderByItems
;
}
public
function
getOrderByItems
()
{
return
$this
->
_orderByItems
;
$this
->
orderByItems
=
$orderByItems
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/OrderByItem.php
View file @
33fc28ff
...
...
@@ -22,48 +22,34 @@
namespace
Doctrine\ORM\Query\AST
;
/**
* AST node for the following grammar rule:
*
* OrderByItem ::= (ResultVariable | StateFieldPathExpression) ["ASC" | "DESC"]
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
class
OrderByItem
extends
Node
{
private
$_expr
;
private
$_asc
;
private
$_desc
;
public
function
__construct
(
$expr
)
{
$this
->
_expr
=
$expr
;
}
public
$expression
;
public
$type
;
public
function
getExpression
(
)
public
function
__construct
(
$expression
)
{
return
$this
->
_expr
;
}
public
function
setAsc
(
$bool
)
{
$this
->
_asc
=
$bool
;
$this
->
expression
=
$expression
;
}
public
function
isAsc
()
{
return
$this
->
_asc
;
}
public
function
setDesc
(
$bool
)
{
$this
->
_desc
=
$bool
;
return
strtoupper
(
$this
->
type
)
==
'ASC'
;
}
public
function
isDesc
()
{
return
$this
->
_desc
;
return
strtoupper
(
$this
->
type
)
==
'DESC'
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/PathExpression.php
View file @
33fc28ff
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
/**
* AST node for the following path expressions:
*
* AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
*
* SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
*
* StateFieldPathExpression ::= SimpleStateFieldPathExpression | SimpleStateFieldAssociationPathExpression
*
* SingleValuedAssociationPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* SingleValuedAssociationField
*
* CollectionValuedPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* CollectionValuedAssociationField
*
* StateField ::= {EmbeddedClassStateField "."}* SimpleStateField
*
* SimpleStateFieldPathExpression ::= IdentificationVariable "." StateField
*
* SimpleStateFieldAssociationPathExpression ::= SingleValuedAssociationPathExpression "." StateField
*
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
PathExpression
extends
Node
{
...
...
@@ -30,54 +45,21 @@ class PathExpression extends Node
const
TYPE_SINGLE_VALUED_ASSOCIATION
=
4
;
const
TYPE_STATE_FIELD
=
8
;
p
rivate
$_
type
;
p
rivate
$_
expectedType
;
p
rivate
$_
identificationVariable
;
p
rivate
$_
parts
;
p
ublic
$
type
;
p
ublic
$
expectedType
;
p
ublic
$
identificationVariable
;
p
ublic
$
parts
;
public
function
__construct
(
$expectedType
,
$identificationVariable
,
array
$parts
)
{
$this
->
_expectedType
=
$expectedType
;
$this
->
_identificationVariable
=
$identificationVariable
;
$this
->
_parts
=
$parts
;
}
public
function
getIdentificationVariable
()
{
return
$this
->
_identificationVariable
;
}
public
function
getParts
()
{
return
$this
->
_parts
;
}
public
function
setExpectedType
(
$type
)
{
$this
->
_expectedType
;
}
public
function
getExpectedType
()
{
return
$this
->
_expectedType
;
}
/**
* INTERNAL
*/
public
function
setType
(
$type
)
{
$this
->
_type
=
$type
;
}
public
function
getType
()
{
return
$this
->
_type
;
$this
->
expectedType
=
$expectedType
;
$this
->
identificationVariable
=
$identificationVariable
;
$this
->
parts
=
$parts
;
}
public
function
dispatch
(
$walker
)
{
switch
(
$this
->
_
type
)
{
switch
(
$this
->
type
)
{
case
self
::
TYPE_STATE_FIELD
:
return
$walker
->
walkStateFieldPathExpression
(
$this
);
case
self
::
TYPE_SINGLE_VALUED_ASSOCIATION
:
...
...
lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,18 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
* QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
QuantifiedExpression
extends
Node
{
private
$_all
;
private
$_any
;
private
$_some
;
private
$_subselect
;
public
$type
;
public
$subselect
;
public
function
__construct
(
$subselect
)
{
$this
->
_
subselect
=
$subselect
;
$this
->
subselect
=
$subselect
;
}
public
function
getSubselect
()
...
...
@@ -30,32 +49,17 @@ class QuantifiedExpression extends Node
public
function
isAll
()
{
return
$this
->
_all
;
return
strtoupper
(
$this
->
type
)
==
'ALL'
;
}
public
function
isAny
()
{
return
$this
->
_any
;
return
strtoupper
(
$this
->
type
)
==
'ANY'
;
}
public
function
isSome
()
{
return
$this
->
_some
;
}
public
function
setAll
(
$bool
)
{
$this
->
_all
=
$bool
;
}
public
function
setAny
(
$bool
)
{
$this
->
_any
=
$bool
;
}
public
function
setSome
(
$bool
)
{
$this
->
_some
=
$bool
;
return
strtoupper
(
$this
->
type
)
==
'SOME'
;
}
/**
...
...
lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php
View file @
33fc28ff
...
...
@@ -24,39 +24,25 @@ namespace Doctrine\ORM\Query\AST;
/**
* RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
RangeVariableDeclaration
extends
Node
{
p
rivate
$_
classMetadata
;
p
rivate
$_
abstractSchemaName
;
p
rivate
$_
aliasIdentificationVariable
;
p
ublic
$
classMetadata
;
p
ublic
$
abstractSchemaName
;
p
ublic
$
aliasIdentificationVariable
;
public
function
__construct
(
$classMetadata
,
$aliasIdentificationVar
)
{
$this
->
_classMetadata
=
$classMetadata
;
$this
->
_abstractSchemaName
=
$classMetadata
->
name
;
$this
->
_aliasIdentificationVariable
=
$aliasIdentificationVar
;
}
/* Getters */
public
function
getAbstractSchemaName
()
{
return
$this
->
_abstractSchemaName
;
}
public
function
getAliasIdentificationVariable
()
{
return
$this
->
_aliasIdentificationVariable
;
}
public
function
getClassMetadata
()
{
return
$this
->
_classMetadata
;
$this
->
classMetadata
=
$classMetadata
;
$this
->
abstractSchemaName
=
$classMetadata
->
name
;
$this
->
aliasIdentificationVariable
=
$aliasIdentificationVar
;
}
public
function
dispatch
(
$walker
)
...
...
lib/Doctrine/ORM/Query/AST/SelectClause.php
View file @
33fc28ff
...
...
@@ -24,50 +24,23 @@ namespace Doctrine\ORM\Query\AST;
/**
* SelectClause = "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SelectClause
extends
Node
{
protected
$_isDistinct
;
protected
$_selectExpressions
=
array
();
public
$isDistinct
;
public
$selectExpressions
=
array
();
public
function
__construct
(
array
$selectExpressions
,
$isDistinct
)
{
$this
->
_isDistinct
=
$isDistinct
;
$this
->
_selectExpressions
=
$selectExpressions
;
}
/* Getters */
public
function
isDistinct
()
{
return
$this
->
_isDistinct
;
}
public
function
getSelectExpressions
()
{
return
$this
->
_selectExpressions
;
}
/* REMOVE ME LATER. COPIED METHODS FROM SPLIT OF PRODUCTION INTO "AST" AND "PARSER" */
public
function
buildSql
()
{
return
'SELECT '
.
((
$this
->
_isDistinct
)
?
'DISTINCT '
:
''
)
.
implode
(
', '
,
$this
->
_mapSelectExpressions
());
}
protected
function
_mapSelectExpressions
()
{
return
array_map
(
array
(
&
$this
,
'_mapSelectExpression'
),
$this
->
_selectExpressions
);
}
protected
function
_mapSelectExpression
(
$value
)
{
return
is_object
(
$value
)
?
$value
->
buildSql
()
:
$value
;
$this
->
isDistinct
=
$isDistinct
;
$this
->
selectExpressions
=
$selectExpressions
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SelectExpression.php
View file @
33fc28ff
...
...
@@ -25,32 +25,23 @@ namespace Doctrine\ORM\Query\AST;
* SelectExpression ::= IdentificationVariable ["." "*"] | StateFieldPathExpression |
* (AggregateExpression | "(" Subselect ")") [["AS"] FieldAliasIdentificationVariable]
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SelectExpression
extends
Node
{
p
rotected
$_
expression
;
p
rotected
$_
fieldIdentificationVariable
;
p
ublic
$
expression
;
p
ublic
$
fieldIdentificationVariable
;
public
function
__construct
(
$expression
,
$fieldIdentificationVariable
)
{
$this
->
_expression
=
$expression
;
$this
->
_fieldIdentificationVariable
=
$fieldIdentificationVariable
;
}
/* Getters */
public
function
getExpression
()
{
return
$this
->
_expression
;
}
public
function
getFieldIdentificationVariable
()
{
return
$this
->
_fieldIdentificationVariable
;
$this
->
expression
=
$expression
;
$this
->
fieldIdentificationVariable
=
$fieldIdentificationVariable
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SelectStatement.php
View file @
33fc28ff
...
...
@@ -24,60 +24,26 @@ namespace Doctrine\ORM\Query\AST;
/**
* SelectStatement = SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SelectStatement
extends
Node
{
protected
$_selectClause
;
protected
$_fromClause
;
protected
$_whereClause
;
protected
$_groupByClause
;
protected
$_havingClause
;
protected
$_orderByClause
;
public
function
__construct
(
$selectClause
,
$fromClause
,
$whereClause
,
$groupByClause
,
$havingClause
,
$orderByClause
)
{
$this
->
_selectClause
=
$selectClause
;
$this
->
_fromClause
=
$fromClause
;
$this
->
_whereClause
=
$whereClause
;
$this
->
_groupByClause
=
$groupByClause
;
$this
->
_havingClause
=
$havingClause
;
$this
->
_orderByClause
=
$orderByClause
;
}
/* Getters */
public
function
getSelectClause
()
{
return
$this
->
_selectClause
;
}
public
function
getFromClause
()
{
return
$this
->
_fromClause
;
}
public
function
getWhereClause
()
{
return
$this
->
_whereClause
;
}
public
function
getGroupByClause
()
{
return
$this
->
_groupByClause
;
}
public
function
getHavingClause
()
{
return
$this
->
_havingClause
;
}
public
function
getOrderByClause
()
{
return
$this
->
_orderByClause
;
public
$selectClause
;
public
$fromClause
;
public
$whereClause
;
public
$groupByClause
;
public
$havingClause
;
public
$orderByClause
;
public
function
__construct
(
$selectClause
,
$fromClause
)
{
$this
->
selectClause
=
$selectClause
;
$this
->
fromClause
=
$fromClause
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
...
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SimpleArithmeticExpression
extends
Node
{
p
rivate
$_terms
;
p
ublic
$arithmeticTerms
=
array
()
;
public
function
__construct
(
array
$arithmeticTerms
)
{
$this
->
_terms
=
$arithmeticTerms
;
}
public
function
getArithmeticTerms
()
{
return
$this
->
_terms
;
$this
->
arithmeticTerms
=
$arithmeticTerms
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php
View file @
33fc28ff
...
...
@@ -24,36 +24,23 @@ namespace Doctrine\ORM\Query\AST;
/**
* SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SimpleSelectClause
extends
Node
{
private
$_isDistinct
=
false
;
private
$_simpleSelectExpression
;
public
function
__construct
(
$simpleSelectExpression
)
{
$this
->
_simpleSelectExpression
=
$simpleSelectExpression
;
}
/* Getters */
public
function
isDistinct
()
{
return
$this
->
_isDistinct
;
}
public
function
setDistinct
(
$bool
)
{
$this
->
_isDistinct
=
$bool
;
}
public
$isDistinct
=
false
;
public
$simpleSelectExpression
;
public
function
getSimpleSelectExpression
(
)
public
function
__construct
(
$simpleSelectExpression
,
$isDistinct
)
{
return
$this
->
_simpleSelectExpression
;
$this
->
simpleSelectExpression
=
$simpleSelectExpression
;
$this
->
isDistinct
=
$isDistinct
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php
View file @
33fc28ff
...
...
@@ -25,35 +25,22 @@ namespace Doctrine\ORM\Query\AST;
* SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable
* | (AggregateExpression [["AS"] FieldAliasIdentificationVariable])
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SimpleSelectExpression
extends
Node
{
p
rivate
$_
expression
;
p
rivate
$_
fieldIdentificationVariable
;
p
ublic
$
expression
;
p
ublic
$
fieldIdentificationVariable
;
public
function
__construct
(
$expression
)
{
$this
->
_expression
=
$expression
;
}
public
function
getExpression
()
{
return
$this
->
_expression
;
}
public
function
getFieldIdentificationVariable
()
{
return
$this
->
_fieldIdentificationVariable
;
}
public
function
setFieldIdentificationVariable
(
$fieldAlias
)
{
$this
->
_fieldIdentificationVariable
=
$fieldAlias
;
$this
->
expression
=
$expression
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/Subselect.php
View file @
33fc28ff
...
...
@@ -24,76 +24,27 @@ namespace Doctrine\ORM\Query\AST;
/**
* Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
Subselect
extends
Node
{
p
rivate
$_
simpleSelectClause
;
p
rivate
$_
subselectFromClause
;
p
rivate
$_
whereClause
;
p
rivate
$_
groupByClause
;
p
rivate
$_
havingClause
;
p
rivate
$_
orderByClause
;
p
ublic
$
simpleSelectClause
;
p
ublic
$
subselectFromClause
;
p
ublic
$
whereClause
;
p
ublic
$
groupByClause
;
p
ublic
$
havingClause
;
p
ublic
$
orderByClause
;
public
function
__construct
(
$simpleSelectClause
,
$subselectFromClause
)
{
$this
->
_simpleSelectClause
=
$simpleSelectClause
;
$this
->
_subselectFromClause
=
$subselectFromClause
;
}
/* Getters */
public
function
getSimpleSelectClause
()
{
return
$this
->
_simpleSelectClause
;
}
public
function
getSubselectFromClause
()
{
return
$this
->
_subselectFromClause
;
}
public
function
getWhereClause
()
{
return
$this
->
_whereClause
;
}
public
function
setWhereClause
(
$whereClause
)
{
$this
->
_whereClause
=
$whereClause
;
}
public
function
getGroupByClause
()
{
return
$this
->
_groupByClause
;
}
public
function
setGroupByClause
(
$groupByClause
)
{
$this
->
_groupByClause
=
$groupByClause
;
}
public
function
getHavingClause
()
{
return
$this
->
_havingClause
;
}
public
function
setHavingClause
(
$havingClause
)
{
$this
->
_havingClause
=
$havingClause
;
}
public
function
getOrderByClause
()
{
return
$this
->
_orderByClause
;
}
public
function
setOrderByClause
(
$orderByClause
)
{
$this
->
_orderByClause
=
$orderByClause
;
$this
->
simpleSelectClause
=
$simpleSelectClause
;
$this
->
subselectFromClause
=
$subselectFromClause
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SubselectFromClause.php
View file @
33fc28ff
...
...
@@ -24,25 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
* SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
SubselectFromClause
extends
Node
{
p
rivate
$_
identificationVariableDeclarations
=
array
();
p
ublic
$
identificationVariableDeclarations
=
array
();
public
function
__construct
(
array
$identificationVariableDeclarations
)
{
$this
->
_identificationVariableDeclarations
=
$identificationVariableDeclarations
;
}
/* Getters */
public
function
getSubselectIdentificationVariableDeclarations
()
{
return
$this
->
_identificationVariableDeclarations
;
$this
->
identificationVariableDeclarations
=
$identificationVariableDeclarations
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/UpdateClause.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
/**
* UpdateClause ::= "UPDATE" AbstractSchemaName [["AS"] AliasIdentificationVariable] "SET" UpdateItem {"," UpdateItem}*
*
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
UpdateClause
extends
Node
{
p
rivate
$_
abstractSchemaName
;
p
rivate
$_
aliasIdentificationVariable
;
p
rivate
$_
updateItems
=
array
();
p
ublic
$
abstractSchemaName
;
p
ublic
$
aliasIdentificationVariable
;
p
ublic
$
updateItems
=
array
();
public
function
__construct
(
$abstractSchemaName
,
array
$updateItems
)
{
$this
->
_abstractSchemaName
=
$abstractSchemaName
;
$this
->
_updateItems
=
$updateItems
;
}
public
function
getAbstractSchemaName
()
{
return
$this
->
_abstractSchemaName
;
}
public
function
getAliasIdentificationVariable
()
{
return
$this
->
_aliasIdentificationVariable
;
}
public
function
setAliasIdentificationVariable
(
$alias
)
{
$this
->
_aliasIdentificationVariable
=
$alias
;
}
public
function
getUpdateItems
()
{
return
$this
->
_updateItems
;
$this
->
abstractSchemaName
=
$abstractSchemaName
;
$this
->
updateItems
=
$updateItems
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/UpdateItem.php
View file @
33fc28ff
...
...
@@ -26,39 +26,24 @@ namespace Doctrine\ORM\Query\AST;
* NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary |
* EnumPrimary | SimpleEntityExpression | "NULL"
*
* @author Roman Borschel <roman@code-factory.org>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
UpdateItem
extends
Node
{
p
rivate
$_
identificationVariable
;
p
rivate
$_
field
;
p
rivate
$_
newValue
;
p
ublic
$
identificationVariable
;
p
ublic
$
field
;
p
ublic
$
newValue
;
public
function
__construct
(
$field
,
$newValue
)
{
$this
->
_field
=
$field
;
$this
->
_newValue
=
$newValue
;
}
public
function
setIdentificationVariable
(
$identVar
)
{
$this
->
_identificationVariable
=
$identVar
;
}
public
function
getIdentificationVariable
()
{
return
$this
->
_identificationVariable
;
}
public
function
getField
()
{
return
$this
->
_field
;
}
public
function
getNewValue
()
{
return
$this
->
_newValue
;
$this
->
field
=
$field
;
$this
->
newValue
=
$newValue
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/UpdateStatement.php
View file @
33fc28ff
...
...
@@ -24,35 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
* UpdateStatement = UpdateClause [WhereClause]
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision$
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
UpdateStatement
extends
Node
{
p
rivate
$_
updateClause
;
p
rivate
$_
whereClause
;
p
ublic
$
updateClause
;
p
ublic
$
whereClause
;
public
function
__construct
(
$updateClause
)
{
$this
->
_updateClause
=
$updateClause
;
}
public
function
setWhereClause
(
$whereClause
)
{
$this
->
_whereClause
=
$whereClause
;
}
public
function
getUpdateClause
()
{
return
$this
->
_updateClause
;
}
public
function
getWhereClause
()
{
return
$this
->
_whereClause
;
$this
->
updateClause
=
$updateClause
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/WhereClause.php
View file @
33fc28ff
<?php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace
Doctrine\ORM\Query\AST
;
/**
*
Description of WhereClause
*
WhereClause ::= "WHERE" ConditionalExpression
*
* @author robo
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link www.doctrine-project.org
* @since 2.0
* @version $Revision: 3938 $
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
class
WhereClause
extends
Node
{
p
rivate
$_
conditionalExpression
;
p
ublic
$
conditionalExpression
;
public
function
__construct
(
$conditionalExpression
)
{
$this
->
_conditionalExpression
=
$conditionalExpression
;
}
public
function
getConditionalExpression
()
{
return
$this
->
_conditionalExpression
;
$this
->
conditionalExpression
=
$conditionalExpression
;
}
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php
View file @
33fc28ff
...
...
@@ -53,9 +53,9 @@ class MultiTableDeleteExecutor extends AbstractSqlExecutor
$conn
=
$em
->
getConnection
();
$primaryClass
=
$sqlWalker
->
getEntityManager
()
->
getClassMetadata
(
$AST
->
getDeleteClause
()
->
getAbstractSchemaName
()
$AST
->
deleteClause
->
abstractSchemaName
);
$primaryDqlAlias
=
$AST
->
getDeleteClause
()
->
getAliasIdentificationVariable
()
;
$primaryDqlAlias
=
$AST
->
deleteClause
->
aliasIdentificationVariable
;
$rootClass
=
$em
->
getClassMetadata
(
$primaryClass
->
rootEntityName
);
$tempTable
=
$rootClass
->
getTemporaryIdTableName
();
...
...
@@ -71,8 +71,8 @@ class MultiTableDeleteExecutor extends AbstractSqlExecutor
$this
->
_insertSql
.=
$sqlWalker
->
walkFromClause
(
$fromClause
);
// Append WHERE clause, if there is one.
if
(
$AST
->
getWhereClause
()
)
{
$this
->
_insertSql
.=
$sqlWalker
->
walkWhereClause
(
$AST
->
getWhereClause
()
);
if
(
$AST
->
whereClause
)
{
$this
->
_insertSql
.=
$sqlWalker
->
walkWhereClause
(
$AST
->
whereClause
);
}
// 2. Create ID subselect statement used in DELETE .... WHERE ... IN (subselect)
...
...
lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php
View file @
33fc28ff
...
...
@@ -53,13 +53,12 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
{
$em
=
$sqlWalker
->
getEntityManager
();
$conn
=
$em
->
getConnection
();
$updateClause
=
$AST
->
updateClause
;
$primaryClass
=
$sqlWalker
->
getEntityManager
()
->
getClassMetadata
(
$AST
->
getUpdateClause
()
->
getAbstractSchemaName
()
);
$primaryClass
=
$sqlWalker
->
getEntityManager
()
->
getClassMetadata
(
$updateClause
->
abstractSchemaName
);
$rootClass
=
$em
->
getClassMetadata
(
$primaryClass
->
rootEntityName
);
$updateItems
=
$
AST
->
getUpdateClause
()
->
getUpdateItems
()
;
$updateItems
=
$
updateClause
->
updateItems
;
$tempTable
=
$rootClass
->
getTemporaryIdTableName
();
$idColumnNames
=
$rootClass
->
getIdentifierColumnNames
();
...
...
@@ -68,8 +67,8 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
// 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause()
$this
->
_insertSql
=
'INSERT INTO '
.
$tempTable
.
' ('
.
$idColumnList
.
')'
.
' SELECT t0.'
.
implode
(
', t0.'
,
$idColumnNames
);
$sqlWalker
->
setSqlTableAlias
(
$primaryClass
->
primaryTable
[
'name'
]
.
$
AST
->
getUpdateClause
()
->
getAliasIdentificationVariable
()
,
't0'
);
$rangeDecl
=
new
AST\RangeVariableDeclaration
(
$primaryClass
,
$
AST
->
getUpdateClause
()
->
getAliasIdentificationVariable
()
);
$sqlWalker
->
setSqlTableAlias
(
$primaryClass
->
primaryTable
[
'name'
]
.
$
updateClause
->
aliasIdentificationVariable
,
't0'
);
$rangeDecl
=
new
AST\RangeVariableDeclaration
(
$primaryClass
,
$
updateClause
->
aliasIdentificationVariable
);
$fromClause
=
new
AST\FromClause
(
array
(
new
AST\IdentificationVariableDeclaration
(
$rangeDecl
,
null
,
array
())));
$this
->
_insertSql
.=
$sqlWalker
->
walkFromClause
(
$fromClause
);
...
...
@@ -79,6 +78,7 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
// 3. Create and store UPDATE statements
$classNames
=
array_merge
(
$primaryClass
->
parentClasses
,
array
(
$primaryClass
->
name
),
$primaryClass
->
subClasses
);
$i
=
-
1
;
foreach
(
array_reverse
(
$classNames
)
as
$className
)
{
$affected
=
false
;
$class
=
$em
->
getClassMetadata
(
$className
);
...
...
@@ -86,19 +86,22 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
$updateSql
=
'UPDATE '
.
$conn
->
quoteIdentifier
(
$tableName
)
.
' SET '
;
foreach
(
$updateItems
as
$updateItem
)
{
$field
=
$updateItem
->
getField
()
;
$field
=
$updateItem
->
field
;
if
(
isset
(
$class
->
fieldMappings
[
$field
])
&&
!
isset
(
$class
->
fieldMappings
[
$field
][
'inherited'
]))
{
$newValue
=
$updateItem
->
getNewValue
();
$newValue
=
$updateItem
->
newValue
;
if
(
!
$affected
)
{
$affected
=
true
;
++
$i
;
}
else
{
$updateSql
.=
', '
;
}
$updateSql
.=
$sqlWalker
->
walkUpdateItem
(
$updateItem
);
//FIXME: parameters can be more deeply nested. traverse the tree.
if
(
$newValue
instanceof
AST\InputParameter
)
{
$paramKey
=
$newValue
->
isNamed
()
?
$newValue
->
getName
()
:
$newValue
->
getPosition
()
;
$paramKey
=
$newValue
->
name
;
$this
->
_sqlParameters
[
$i
][]
=
$sqlWalker
->
getQuery
()
->
getParameter
(
$paramKey
);
++
$this
->
_numParametersInUpdateClause
;
}
...
...
@@ -111,8 +114,8 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
}
// Append WHERE clause to insertSql, if there is one.
if
(
$AST
->
getWhereClause
()
)
{
$this
->
_insertSql
.=
$sqlWalker
->
walkWhereClause
(
$AST
->
getWhereClause
()
);
if
(
$AST
->
whereClause
)
{
$this
->
_insertSql
.=
$sqlWalker
->
walkWhereClause
(
$AST
->
whereClause
);
}
// 4. Store DDL for temporary identifier table.
...
...
lib/Doctrine/ORM/Query/Parser.php
View file @
33fc28ff
This diff is collapsed.
Click to expand it.
lib/Doctrine/ORM/Query/SqlWalker.php
View file @
33fc28ff
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment