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;
...
@@ -30,7 +30,12 @@ use Doctrine\DBAL\Types;
* point of abstraction of platform-specific behaviors, features and SQL dialects.
* point of abstraction of platform-specific behaviors, features and SQL dialects.
* They are a passive source of information.
* 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
* @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 Roman Borschel <roman@code-factory.org>
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
* @author Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library)
*/
*/
...
...
lib/Doctrine/ORM/AbstractQuery.php
View file @
33fc28ff
...
@@ -21,6 +21,8 @@
...
@@ -21,6 +21,8 @@
namespace
Doctrine\ORM
;
namespace
Doctrine\ORM
;
use
Doctrine\ORM\Query\QueryException
;
/**
/**
* Base class for Query and NativeQuery.
* Base class for Query and NativeQuery.
*
*
...
...
lib/Doctrine/ORM/Query/AST/ArithmeticFactor.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,34 +24,40 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,34 +24,40 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* ArithmeticFactor ::= [("+" | "-")] ArithmeticPrimary
* 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
class
ArithmeticFactor
extends
Node
{
{
private
$_arithmeticPrimary
;
/**
private
$_pSigned
;
* @var ArithmeticPrimary
private
$_nSigned
;
*/
public
$arithmeticPrimary
;
public
function
__construct
(
$arithmeticPrimary
,
$pSigned
=
false
,
$nSigned
=
false
)
/**
{
* @var null|boolean NULL represents no sign, TRUE means positive and FALSE means negative sign
$this
->
_arithmeticPrimary
=
$arithmeticPrimary
;
*/
$this
->
_pSigned
=
$pSigned
;
public
$sign
;
$this
->
_nSigned
=
$nSigned
;
}
public
function
getArithmeticPrimary
(
)
public
function
__construct
(
$arithmeticPrimary
,
$sign
=
null
)
{
{
return
$this
->
_arithmeticPrimary
;
$this
->
arithmeticPrimary
=
$arithmeticPrimary
;
$this
->
sign
=
$sign
;
}
}
public
function
isPositiveSigned
()
public
function
isPositiveSigned
()
{
{
return
$this
->
_pSigned
;
return
$this
->
sign
===
true
;
}
}
public
function
isNegativeSigned
()
public
function
isNegativeSigned
()
{
{
return
$this
->
_nSigned
;
return
$this
->
sign
===
false
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ArithmeticTerm.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* ArithmeticTerm ::= ArithmeticFactor {("*" | "/") ArithmeticFactor}*
* 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
class
ArithmeticTerm
extends
Node
{
{
p
rivate
$_f
actors
;
p
ublic
$arithmeticF
actors
;
public
function
__construct
(
array
$arithmeticFactors
)
public
function
__construct
(
array
$arithmeticFactors
)
{
{
$this
->
_factors
=
$arithmeticFactors
;
$this
->
arithmeticFactors
=
$arithmeticFactors
;
}
public
function
getArithmeticFactors
()
{
return
$this
->
_factors
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/BetweenExpression.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,45 +24,26 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,45 +24,26 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* Description of BetweenExpression
* 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
class
BetweenExpression
extends
Node
{
{
private
$_baseExpression
;
public
$expression
;
private
$_leftBetweenExpression
;
public
$leftBetweenExpression
;
private
$_rightBetweenExpression
;
public
$rightBetweenExpression
;
private
$_not
;
public
$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
function
getNot
(
)
public
function
__construct
(
$expr
,
$leftExpr
,
$rightExpr
)
{
{
return
$this
->
_not
;
$this
->
expression
=
$expr
;
$this
->
leftBetweenExpression
=
$leftExpr
;
$this
->
rightBetweenExpression
=
$rightExpr
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/CollectionMemberExpression.php
View file @
33fc28ff
<?php
<?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
;
namespace
Doctrine\ORM\Query\AST
;
/**
/**
* CollectionMemberExpression ::= EntityExpression ["NOT"] "MEMBER" ["OF"] CollectionValuedPathExpression
* 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>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
CollectionMemberExpression
extends
Node
class
CollectionMemberExpression
extends
Node
{
{
public
$entityExpression
;
public
$entityExpression
;
public
$collectionValuedPathExpression
;
public
$collectionValuedPathExpression
;
public
$
isN
ot
;
public
$
n
ot
;
public
function
__construct
(
$entityExpr
,
$collValuedPathExpr
,
$isNot
)
public
function
__construct
(
$entityExpr
,
$collValuedPathExpr
)
{
{
$this
->
entityExpression
=
$entityExpr
;
$this
->
entityExpression
=
$entityExpr
;
$this
->
collectionValuedPathExpression
=
$collValuedPathExpr
;
$this
->
collectionValuedPathExpression
=
$collValuedPathExpr
;
$this
->
isNot
=
$isNot
;
}
}
public
function
dispatch
(
$walker
)
public
function
dispatch
(
$walker
)
...
...
lib/Doctrine/ORM/Query/AST/ComparisonExpression.php
View file @
33fc28ff
...
@@ -29,34 +29,25 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -29,34 +29,25 @@ namespace Doctrine\ORM\Query\AST;
* DatetimeExpression ComparisonOperator (DatetimeExpression | QuantifiedExpression) |
* DatetimeExpression ComparisonOperator (DatetimeExpression | QuantifiedExpression) |
* EntityExpression ("=" | "<>") (EntityExpression | 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
class
ComparisonExpression
extends
Node
{
{
p
rivate
$_leftExpr
;
p
ublic
$leftExpression
;
p
rivate
$_rightExpr
;
p
ublic
$rightExpression
;
p
rivate
$_
operator
;
p
ublic
$
operator
;
public
function
__construct
(
$leftExpr
,
$operator
,
$rightExpr
)
public
function
__construct
(
$leftExpr
,
$operator
,
$rightExpr
)
{
{
$this
->
_leftExpr
=
$leftExpr
;
$this
->
leftExpression
=
$leftExpr
;
$this
->
_rightExpr
=
$rightExpr
;
$this
->
rightExpression
=
$rightExpr
;
$this
->
_operator
=
$operator
;
$this
->
operator
=
$operator
;
}
public
function
getLeftExpression
()
{
return
$this
->
_leftExpr
;
}
public
function
getRightExpression
()
{
return
$this
->
_rightExpr
;
}
public
function
getOperator
()
{
return
$this
->
_operator
;
}
}
public
function
dispatch
(
$sqlWalker
)
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
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}*
* 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
class
ConditionalExpression
extends
Node
{
{
p
rivate
$_
conditionalTerms
=
array
();
p
ublic
$
conditionalTerms
=
array
();
public
function
__construct
(
array
$conditionalTerms
)
public
function
__construct
(
array
$conditionalTerms
)
{
{
$this
->
_conditionalTerms
=
$conditionalTerms
;
$this
->
conditionalTerms
=
$conditionalTerms
;
}
public
function
getConditionalTerms
()
{
return
$this
->
_conditionalTerms
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ConditionalFactor.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,27 +24,22 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,27 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* ConditionalFactor ::= ["NOT"] ConditionalPrimary
* 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
class
ConditionalFactor
extends
Node
{
{
private
$_not
=
false
;
public
$not
=
false
;
private
$_conditionalPrimary
;
public
$conditionalPrimary
;
public
function
__construct
(
$conditionalPrimary
,
$not
=
false
)
{
$this
->
_conditionalPrimary
=
$conditionalPrimary
;
$this
->
_not
=
$not
;
}
public
function
isNot
()
{
return
$this
->
_not
;
}
public
function
getConditionalPrimary
(
)
public
function
__construct
(
$conditionalPrimary
)
{
{
return
$this
->
_
conditionalPrimary
;
$this
->
conditionalPrimary
=
$
conditionalPrimary
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ConditionalPrimary.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,41 +24,27 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,41 +24,27 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* ConditionalPrimary ::= SimpleConditionalExpression | "(" ConditionalExpression ")"
* 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
class
ConditionalPrimary
extends
Node
{
{
private
$_simpleConditionalExpression
;
public
$simpleConditionalExpression
;
private
$_conditionalExpression
;
public
$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
function
isSimpleConditionalExpression
()
public
function
isSimpleConditionalExpression
()
{
{
return
(
bool
)
$this
->
_
simpleConditionalExpression
;
return
(
bool
)
$this
->
simpleConditionalExpression
;
}
}
public
function
isConditionalExpression
()
public
function
isConditionalExpression
()
{
{
return
(
bool
)
$this
->
_
conditionalExpression
;
return
(
bool
)
$this
->
conditionalExpression
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ConditionalTerm.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}*
* 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
class
ConditionalTerm
extends
Node
{
{
p
rivate
$_
conditionalFactors
=
array
();
p
ublic
$
conditionalFactors
=
array
();
public
function
__construct
(
array
$conditionalFactors
)
public
function
__construct
(
array
$conditionalFactors
)
{
{
$this
->
_conditionalFactors
=
$conditionalFactors
;
$this
->
conditionalFactors
=
$conditionalFactors
;
}
public
function
getConditionalFactors
()
{
return
$this
->
_conditionalFactors
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/DeleteClause.php
View file @
33fc28ff
...
@@ -23,30 +23,23 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -23,30 +23,23 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* DeleteClause ::= "DELETE" ["FROM"] AbstractSchemaName [["AS"] AliasIdentificationVariable]
* 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
class
DeleteClause
extends
Node
{
{
p
rivate
$_
abstractSchemaName
;
p
ublic
$
abstractSchemaName
;
p
rivate
$_
aliasIdentificationVariable
;
p
ublic
$
aliasIdentificationVariable
;
public
function
__construct
(
$abstractSchemaName
)
public
function
__construct
(
$abstractSchemaName
)
{
{
$this
->
_abstractSchemaName
=
$abstractSchemaName
;
$this
->
abstractSchemaName
=
$abstractSchemaName
;
}
public
function
getAbstractSchemaName
()
{
return
$this
->
_abstractSchemaName
;
}
public
function
getAliasIdentificationVariable
()
{
return
$this
->
_aliasIdentificationVariable
;
}
public
function
setAliasIdentificationVariable
(
$alias
)
{
$this
->
_aliasIdentificationVariable
=
$alias
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/DeleteStatement.php
View file @
33fc28ff
...
@@ -24,35 +24,22 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,35 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* DeleteStatement = DeleteClause [WhereClause]
* DeleteStatement = DeleteClause [WhereClause]
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @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
class
DeleteStatement
extends
Node
{
{
p
rivate
$_
deleteClause
;
p
ublic
$
deleteClause
;
p
rivate
$_
whereClause
;
p
ublic
$
whereClause
;
public
function
__construct
(
$deleteClause
)
public
function
__construct
(
$deleteClause
)
{
{
$this
->
_deleteClause
=
$deleteClause
;
$this
->
deleteClause
=
$deleteClause
;
}
public
function
setWhereClause
(
$whereClause
)
{
$this
->
_whereClause
=
$whereClause
;
}
public
function
getDeleteClause
()
{
return
$this
->
_deleteClause
;
}
public
function
getWhereClause
()
{
return
$this
->
_whereClause
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/EmptyCollectionComparisonExpression.php
View file @
33fc28ff
<?php
<?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
;
namespace
Doctrine\ORM\Query\AST
;
/**
/**
* EmptyCollectionComparisonExpression ::= CollectionValuedPathExpression "IS" ["NOT"] "EMPTY"
* 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 Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
EmptyCollectionComparisonExpression
extends
Node
class
EmptyCollectionComparisonExpression
extends
Node
{
{
p
rivate
$_
expression
;
p
ublic
$
expression
;
p
rivate
$_
not
;
p
ublic
$
not
;
public
function
__construct
(
$expression
)
public
function
__construct
(
$expression
)
{
{
$this
->
_expression
=
$expression
;
$this
->
expression
=
$expression
;
}
public
function
getExpression
()
{
return
$this
->
_expression
;
}
public
function
setNot
(
$bool
)
{
$this
->
_not
=
$bool
;
}
public
function
isNot
()
{
return
$this
->
_not
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/ExistsExpression.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,31 +24,22 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,31 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* ExistsExpression ::= ["NOT"] "EXISTS" "(" Subselect ")"
* 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
class
ExistsExpression
extends
Node
{
{
p
rivate
$_not
=
false
;
p
ublic
$not
;
p
rivate
$_
subselect
;
p
ublic
$
subselect
;
public
function
__construct
(
$subselect
)
public
function
__construct
(
$subselect
)
{
{
$this
->
_subselect
=
$subselect
;
$this
->
subselect
=
$subselect
;
}
public
function
setNot
(
$bool
)
{
$this
->
_not
=
$bool
;
}
public
function
isNot
()
{
return
$this
->
_not
;
}
public
function
getSubselect
()
{
return
$this
->
_subselect
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/FromClause.php
View file @
33fc28ff
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
*
*
* This software consists of voluntary contributions made by many individuals
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* and is licensed under the LGPL. For more information, see
* <http://www.
phpdoctrine
.org>.
* <http://www.
doctrine-project
.org>.
*/
*/
namespace
Doctrine\ORM\Query\AST
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -24,25 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,25 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}
* FromClause ::= "FROM" IdentificationVariableDeclaration {"," IdentificationVariableDeclaration}
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @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
class
FromClause
extends
Node
{
{
p
rotected
$_
identificationVariableDeclarations
=
array
();
p
ublic
$
identificationVariableDeclarations
=
array
();
public
function
__construct
(
array
$identificationVariableDeclarations
)
public
function
__construct
(
array
$identificationVariableDeclarations
)
{
{
$this
->
_identificationVariableDeclarations
=
$identificationVariableDeclarations
;
$this
->
identificationVariableDeclarations
=
$identificationVariableDeclarations
;
}
/* Getters */
public
function
getIdentificationVariableDeclarations
()
{
return
$this
->
_identificationVariableDeclarations
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,24 +24,26 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,24 +24,26 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "ABS" "(" SimpleArithmeticExpression ")"
* "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>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
AbsFunction
extends
FunctionNode
class
AbsFunction
extends
FunctionNode
{
{
private
$_simpleArithmeticExpression
;
public
$simpleArithmeticExpression
;
public
function
getSimpleArithmeticExpression
()
{
return
$this
->
_simpleArithmeticExpression
;
}
/**
/**
* @override
* @override
*/
*/
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
//TODO: Use platform to get SQL
return
'ABS('
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
return
'ABS('
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_simpleArithmeticExpression
)
.
')'
;
$this
->
simpleArithmeticExpression
)
.
')'
;
}
}
/**
/**
...
@@ -37,7 +54,7 @@ class AbsFunction extends FunctionNode
...
@@ -37,7 +54,7 @@ class AbsFunction extends FunctionNode
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_
simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/ConcatFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,22 +24,18 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,22 +24,18 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "CONCAT" "(" StringPrimary "," StringPrimary ")"
* "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>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
ConcatFunction
extends
FunctionNode
class
ConcatFunction
extends
FunctionNode
{
{
private
$_firstStringPrimary
;
public
$firstStringPrimary
;
private
$_secondStringPriamry
;
public
$secondStringPriamry
;
public
function
getFirstStringPrimary
()
{
return
$this
->
_firstStringPrimary
;
}
public
function
getSecondStringPrimary
()
{
return
$this
->
_secondStringPrimary
;
}
/**
/**
* @override
* @override
...
@@ -33,8 +44,8 @@ class ConcatFunction extends FunctionNode
...
@@ -33,8 +44,8 @@ class ConcatFunction extends FunctionNode
{
{
$platform
=
$sqlWalker
->
getConnection
()
->
getDatabasePlatform
();
$platform
=
$sqlWalker
->
getConnection
()
->
getDatabasePlatform
();
return
$platform
->
getConcatExpression
(
return
$platform
->
getConcatExpression
(
$sqlWalker
->
walkStringPrimary
(
$this
->
_
firstStringPrimary
),
$sqlWalker
->
walkStringPrimary
(
$this
->
firstStringPrimary
),
$sqlWalker
->
walkStringPrimary
(
$this
->
_
secondStringPrimary
)
$sqlWalker
->
walkStringPrimary
(
$this
->
secondStringPrimary
)
);
);
}
}
...
@@ -47,9 +58,9 @@ class ConcatFunction extends FunctionNode
...
@@ -47,9 +58,9 @@ class ConcatFunction extends FunctionNode
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_
firstStringPrimary
=
$parser
->
StringPrimary
();
$this
->
firstStringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
','
);
$parser
->
match
(
','
);
$this
->
_
secondStringPrimary
=
$parser
->
StringPrimary
();
$this
->
secondStringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/CurrentDateFunction.php
View file @
33fc28ff
<?php
<?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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
/**
/**
* "CURRENT_DATE"
* "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
class
CurrentDateFunction
extends
FunctionNode
{
{
...
...
lib/Doctrine/ORM/Query/AST/Functions/CurrentTimeFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,7 +24,13 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,7 +24,13 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "CURRENT_TIME"
* "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
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;
...
@@ -24,22 +24,23 @@ namespace Doctrine\ORM\Query\AST\Functions;
use
Doctrine\ORM\Query\AST\Node
;
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
abstract
class
FunctionNode
extends
Node
{
{
p
rivate
$_
name
;
p
ublic
$
name
;
public
function
__construct
(
$name
)
public
function
__construct
(
$name
)
{
{
$this
->
_name
=
$name
;
$this
->
name
=
$name
;
}
public
function
getName
()
{
return
$this
->
_name
;
}
}
abstract
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
);
abstract
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
);
...
...
lib/Doctrine/ORM/Query/AST/Functions/LengthFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "LENGTH" "(" StringPrimary ")"
* "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>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
LengthFunction
extends
FunctionNode
class
LengthFunction
extends
FunctionNode
{
{
private
$_stringPrimary
;
public
$stringPrimary
;
public
function
getStringPrimary
()
{
return
$this
->
_stringPrimary
;
}
/**
/**
* @override
* @override
...
@@ -26,7 +42,7 @@ class LengthFunction extends FunctionNode
...
@@ -26,7 +42,7 @@ class LengthFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
//TODO: Use platform to get SQL
//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
...
@@ -35,9 +51,12 @@ class LengthFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
{
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/LocateFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,28 +24,19 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,28 +24,19 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "LOCATE" "(" StringPrimary "," StringPrimary ["," SimpleArithmeticExpression]")"
* "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
class
LocateFunction
extends
FunctionNode
{
{
private
$_firstStringPrimary
;
public
$firstStringPrimary
;
private
$_secondStringPrimary
;
public
$secondStringPrimary
;
private
$_simpleArithmeticExpression
;
public
$simpleArithmeticExpression
;
public
function
getFirstStringPrimary
()
{
return
$this
->
_firstStringPrimary
;
}
public
function
getSecondStringPrimary
()
{
return
$this
->
_secondStringPrimary
;
}
public
function
getSimpleArithmeticExpression
()
{
return
$this
->
_simpleArithmeticExpression
;
}
/**
/**
* @override
* @override
...
@@ -38,15 +44,12 @@ class LocateFunction extends FunctionNode
...
@@ -38,15 +44,12 @@ class LocateFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
//TODO: Use platform to get SQL
//TODO: Use platform to get SQL
$sql
=
'LOCATE('
.
return
'LOCATE('
.
$sqlWalker
->
walkStringPrimary
(
$this
->
firstStringPrimary
)
.
', '
$sqlWalker
->
walkStringPrimary
(
$this
->
_firstStringPrimary
)
.
$sqlWalker
->
walkStringPrimary
(
$this
->
secondStringPrimary
)
.
', '
.
.
((
$this
->
simpleArithmeticExpression
)
$sqlWalker
->
walkStringPrimary
(
$this
->
_secondStringPrimary
);
?
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
simpleArithmeticExpression
)
:
''
if
(
$this
->
_simpleArithmeticExpression
)
{
)
.
')'
;
$sql
.=
', '
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_simpleArithmeticExpression
);
}
return
$sql
.
')'
;
}
}
/**
/**
...
@@ -55,15 +58,22 @@ class LocateFunction extends FunctionNode
...
@@ -55,15 +58,22 @@ class LocateFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
{
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_firstStringPrimary
=
$parser
->
StringPrimary
();
$this
->
firstStringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
','
);
$parser
->
match
(
','
);
$this
->
_secondStringPrimary
=
$parser
->
StringPrimary
();
$this
->
secondStringPrimary
=
$parser
->
StringPrimary
();
if
(
$lexer
->
isNextToken
(
','
))
{
if
(
$lexer
->
isNextToken
(
','
))
{
$parser
->
match
(
','
);
$parser
->
match
(
','
);
$this
->
_simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
}
}
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/LowerFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "LOWER" "(" StringPrimary ")"
* "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
class
LowerFunction
extends
FunctionNode
{
{
private
$_stringPrimary
;
public
$stringPrimary
;
public
function
getStringPrimary
()
{
return
$this
->
_stringPrimary
;
}
/**
/**
* @override
* @override
...
@@ -26,7 +42,7 @@ class LowerFunction extends FunctionNode
...
@@ -26,7 +42,7 @@ class LowerFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
//TODO: Use platform to get SQL
//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
...
@@ -35,9 +51,12 @@ class LowerFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
{
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,22 +24,18 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,22 +24,18 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "MOD" "(" SimpleArithmeticExpression "," SimpleArithmeticExpression ")"
* "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
class
ModFunction
extends
FunctionNode
{
{
private
$_firstSimpleArithmeticExpression
;
public
$firstSimpleArithmeticExpression
;
private
$_secondSimpleArithmeticExpression
;
public
$secondSimpleArithmeticExpression
;
public
function
getFirstSimpleArithmeticExpression
()
{
return
$this
->
_firstSimpleArithmeticExpression
;
}
public
function
getSecondSimpleArithmeticExpression
()
{
return
$this
->
_secondSimpleArithmeticExpression
;
}
/**
/**
* @override
* @override
...
@@ -32,10 +43,10 @@ class ModFunction extends FunctionNode
...
@@ -32,10 +43,10 @@ class ModFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
//TODO: Use platform to get SQL
//TODO: Use platform to get SQL
return
'SQRT('
.
return
'SQRT('
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_firstSimpleArithmeticExpression
)
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_firstSimpleArithmeticExpression
)
.
', '
.
.
', '
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_secondSimpleArithmeticExpression
)
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_secondSimpleArithmeticExpression
)
.
')'
;
.
')'
;
}
}
...
@@ -45,11 +56,16 @@ class ModFunction extends FunctionNode
...
@@ -45,11 +56,16 @@ class ModFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
{
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_firstSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
firstSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
','
);
$parser
->
match
(
','
);
$this
->
_secondSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
secondSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/SizeFunction.php
View file @
33fc28ff
...
@@ -24,30 +24,26 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -24,30 +24,26 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "SIZE" "(" CollectionValuedPathExpression ")"
* "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>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
SizeFunction
extends
FunctionNode
class
SizeFunction
extends
FunctionNode
{
{
private
$_collectionPathExpression
;
public
$collectionPathExpression
;
public
function
getCollectionPathExpression
()
{
return
$this
->
_collectionPathExpression
;
}
public
function
setCollectionPathExpression
(
$collPathExpr
)
{
$this
->
_collectionPathExpression
=
$collPathExpr
;
}
/**
/**
* @override
* @override
*/
*/
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
$dqlAlias
=
$this
->
_collectionPathExpression
->
getIdentificationVariable
()
;
$dqlAlias
=
$this
->
collectionPathExpression
->
identificationVariable
;
$qComp
=
$sqlWalker
->
getQueryComponent
(
$dqlAlias
);
$qComp
=
$sqlWalker
->
getQueryComponent
(
$dqlAlias
);
$parts
=
$this
->
_collectionPathExpression
->
getParts
()
;
$parts
=
$this
->
collectionPathExpression
->
parts
;
$assoc
=
$qComp
[
'metadata'
]
->
associationMappings
[
$parts
[
0
]];
$assoc
=
$qComp
[
'metadata'
]
->
associationMappings
[
$parts
[
0
]];
...
@@ -80,9 +76,12 @@ class SizeFunction extends FunctionNode
...
@@ -80,9 +76,12 @@ class SizeFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
{
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_collectionPathExpression
=
$parser
->
CollectionValuedPathExpression
();
$this
->
collectionPathExpression
=
$parser
->
CollectionValuedPathExpression
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "SQRT" "(" SimpleArithmeticExpression ")"
* "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>
* @author Roman Borschel <roman@code-factory.org>
*/
*/
class
SqrtFunction
extends
FunctionNode
class
SqrtFunction
extends
FunctionNode
{
{
private
$_simpleArithmeticExpression
;
public
$simpleArithmeticExpression
;
public
function
getSimpleArithmeticExpression
()
{
return
$this
->
_simpleArithmeticExpression
;
}
/**
/**
* @override
* @override
...
@@ -26,7 +42,7 @@ class SqrtFunction extends FunctionNode
...
@@ -26,7 +42,7 @@ class SqrtFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
//TODO: Use platform to get SQL
//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
...
@@ -35,9 +51,12 @@ class SqrtFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
{
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
simpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,28 +24,19 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,28 +24,19 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "SUBSTRING" "(" StringPrimary "," SimpleArithmeticExpression "," SimpleArithmeticExpression ")"
* "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
class
SubstringFunction
extends
FunctionNode
{
{
private
$_stringPrimary
;
public
$stringPrimary
;
private
$_firstSimpleArithmeticExpression
;
public
$firstSimpleArithmeticExpression
;
private
$_secondSimpleArithmeticExpression
;
public
$secondSimpleArithmeticExpression
;
public
function
geStringPrimary
()
{
return
$this
->
_stringPrimary
;
}
public
function
getSecondSimpleArithmeticExpression
()
{
return
$this
->
_secondSimpleArithmeticExpression
;
}
public
function
getFirstSimpleArithmeticExpression
()
{
return
$this
->
_firstSimpleArithmeticExpression
;
}
/**
/**
* @override
* @override
...
@@ -38,14 +44,13 @@ class SubstringFunction extends FunctionNode
...
@@ -38,14 +44,13 @@ class SubstringFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
//TODO: Use platform to get SQL
//TODO: Use platform to get SQL
$sql
=
'SUBSTRING('
.
return
'SUBSTRING('
$sqlWalker
->
walkStringPrimary
(
$this
->
_
stringPrimary
)
.
$sqlWalker
->
walkStringPrimary
(
$this
->
stringPrimary
)
.
', '
.
.
', '
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_
firstSimpleArithmeticExpression
)
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
firstSimpleArithmeticExpression
)
.
', '
.
.
', '
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
_
secondSimpleArithmeticExpression
)
.
$sqlWalker
->
walkSimpleArithmeticExpression
(
$this
->
secondSimpleArithmeticExpression
)
.
')'
;
.
')'
;
return
$sql
;
}
}
/**
/**
...
@@ -54,14 +59,18 @@ class SubstringFunction extends FunctionNode
...
@@ -54,14 +59,18 @@ class SubstringFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
{
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
','
);
$parser
->
match
(
','
);
$this
->
_firstSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
firstSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
','
);
$parser
->
match
(
','
);
$this
->
_secondSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$this
->
secondSimpleArithmeticExpression
=
$parser
->
SimpleArithmeticExpression
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -11,60 +26,21 @@ use Doctrine\ORM\Query\Lexer;
...
@@ -11,60 +26,21 @@ use Doctrine\ORM\Query\Lexer;
/**
/**
* "TRIM" "(" [["LEADING" | "TRAILING" | "BOTH"] [char] "FROM"] StringPrimary ")"
* "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
class
TrimFunction
extends
FunctionNode
{
{
private
$_leading
;
public
$leading
;
private
$_trailing
;
public
$trailing
;
private
$_both
;
public
$both
;
private
$_trimChar
;
public
$trimChar
;
private
$_stringPrimary
;
public
$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
;
}
/**
/**
* @override
* @override
...
@@ -72,13 +48,20 @@ class TrimFunction extends FunctionNode
...
@@ -72,13 +48,20 @@ class TrimFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
$sql
=
'TRIM('
;
$sql
=
'TRIM('
;
if
(
$this
->
_leading
)
$sql
.=
'LEADING '
;
else
if
(
$this
->
_trailing
)
$sql
.=
'TRAILING '
;
if
(
$this
->
leading
)
{
else
if
(
$this
->
_both
)
$sql
.=
'BOTH '
;
$sql
.=
'LEADING '
;
if
(
$this
->
_trimChar
)
$sql
.=
$sqlWalker
->
getConnection
()
->
quote
(
$this
->
_trimChar
)
.
' '
;
}
else
if
(
$this
->
trailing
)
{
$sql
.=
'FROM '
.
$sqlWalker
->
walkStringPrimary
(
$this
->
_stringPrimary
);
$sql
.=
'TRAILING '
;
$sql
.=
')'
;
}
else
if
(
$this
->
both
)
{
return
$sql
;
$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
...
@@ -87,30 +70,31 @@ class TrimFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
{
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
if
(
strcasecmp
(
'leading'
,
$lexer
->
lookahead
[
'value'
])
===
0
)
{
if
(
strcasecmp
(
'leading'
,
$lexer
->
lookahead
[
'value'
])
===
0
)
{
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$this
->
_
leading
=
true
;
$this
->
leading
=
true
;
}
else
if
(
strcasecmp
(
'trailing'
,
$lexer
->
lookahead
[
'value'
])
===
0
)
{
}
else
if
(
strcasecmp
(
'trailing'
,
$lexer
->
lookahead
[
'value'
])
===
0
)
{
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$this
->
_
trailing
=
true
;
$this
->
trailing
=
true
;
}
else
if
(
strcasecmp
(
'both'
,
$lexer
->
lookahead
[
'value'
])
===
0
)
{
}
else
if
(
strcasecmp
(
'both'
,
$lexer
->
lookahead
[
'value'
])
===
0
)
{
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$this
->
_
both
=
true
;
$this
->
both
=
true
;
}
}
if
(
$lexer
->
isNextToken
(
Lexer
::
T_STRING
))
{
if
(
$lexer
->
isNextToken
(
Lexer
::
T_STRING
))
{
$parser
->
match
(
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
);
$parser
->
match
(
Lexer
::
T_FROM
);
}
}
$this
->
_
stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
...
...
lib/Doctrine/ORM/Query/AST/Functions/UpperFunction.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST\Functions
;
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
...
@@ -9,16 +24,17 @@ namespace Doctrine\ORM\Query\AST\Functions;
/**
/**
* "UPPER" "(" StringPrimary ")"
* "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
class
UpperFunction
extends
FunctionNode
{
{
private
$_stringPrimary
;
public
$stringPrimary
;
public
function
getStringPrimary
()
{
return
$this
->
_stringPrimary
;
}
/**
/**
* @override
* @override
...
@@ -26,7 +42,7 @@ class UpperFunction extends FunctionNode
...
@@ -26,7 +42,7 @@ class UpperFunction extends FunctionNode
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
public
function
getSql
(
\Doctrine\ORM\Query\SqlWalker
$sqlWalker
)
{
{
//TODO: Use platform to get SQL
//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
...
@@ -35,9 +51,12 @@ class UpperFunction extends FunctionNode
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
public
function
parse
(
\Doctrine\ORM\Query\Parser
$parser
)
{
{
$lexer
=
$parser
->
getLexer
();
$lexer
=
$parser
->
getLexer
();
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
$lexer
->
lookahead
[
'value'
]);
$parser
->
match
(
'('
);
$parser
->
match
(
'('
);
$this
->
_stringPrimary
=
$parser
->
StringPrimary
();
$this
->
stringPrimary
=
$parser
->
StringPrimary
();
$parser
->
match
(
')'
);
$parser
->
match
(
')'
);
}
}
}
}
...
...
lib/Doctrine/ORM/Query/AST/GroupByClause.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* Description of GroupByClause
* 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
class
GroupByClause
extends
Node
{
{
p
rivate
$_
groupByItems
=
array
();
p
ublic
$
groupByItems
=
array
();
public
function
__construct
(
array
$groupByItems
)
public
function
__construct
(
array
$groupByItems
)
{
{
$this
->
_groupByItems
=
$groupByItems
;
$this
->
groupByItems
=
$groupByItems
;
}
public
function
getGroupByItems
()
{
return
$this
->
_groupByItems
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/HavingClause.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* Description of HavingClause
* 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
class
HavingClause
extends
Node
{
{
p
rivate
$_
conditionalExpression
;
p
ublic
$
conditionalExpression
;
public
function
__construct
(
$conditionalExpression
)
public
function
__construct
(
$conditionalExpression
)
{
{
$this
->
_conditionalExpression
=
$conditionalExpression
;
$this
->
conditionalExpression
=
$conditionalExpression
;
}
public
function
getConditionalExpression
()
{
return
$this
->
_conditionalExpression
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/IdentificationVariableDeclaration.php
View file @
33fc28ff
...
@@ -24,43 +24,25 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,43 +24,25 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}*
* IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {JoinVariableDeclaration}*
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
class
IdentificationVariableDeclaration
extends
Node
{
{
protected
$_rangeVariableDeclaration
=
null
;
public
$rangeVariableDeclaration
=
null
;
public
$indexBy
=
null
;
protected
$_indexBy
=
null
;
public
$joinVariableDeclarations
=
array
();
protected
$_joinVariableDeclarations
=
array
();
public
function
__construct
(
$rangeVariableDecl
,
$indexBy
,
array
$joinVariableDecls
)
public
function
__construct
(
$rangeVariableDecl
,
$indexBy
,
array
$joinVariableDecls
)
{
{
$this
->
_rangeVariableDeclaration
=
$rangeVariableDecl
;
$this
->
rangeVariableDeclaration
=
$rangeVariableDecl
;
$this
->
_indexBy
=
$indexBy
;
$this
->
indexBy
=
$indexBy
;
$this
->
_joinVariableDeclarations
=
$joinVariableDecls
;
$this
->
joinVariableDeclarations
=
$joinVariableDecls
;
}
/* Getters */
public
function
getRangeVariableDeclaration
()
{
return
$this
->
_rangeVariableDeclaration
;
}
public
function
getIndexBy
()
{
return
$this
->
_indexBy
;
}
public
function
getJoinVariableDeclarations
()
{
return
$this
->
_joinVariableDeclarations
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/InExpression.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,53 +24,24 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,53 +24,24 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* InExpression ::= StateFieldPathExpression ["NOT"] "IN" "(" (Literal {"," Literal}* | Subselect) ")"
* 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
class
InExpression
extends
Node
{
{
p
rivate
$_pathExpression
;
p
ublic
$not
;
p
rivate
$_not
=
false
;
p
ublic
$pathExpression
;
p
rivate
$_
literals
=
array
();
p
ublic
$
literals
=
array
();
p
rivate
$_
subselect
;
p
ublic
$
subselect
;
public
function
__construct
(
$pathExpression
)
public
function
__construct
(
$pathExpression
)
{
{
$this
->
_pathExpression
=
$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
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/IndexBy.php
View file @
33fc28ff
...
@@ -24,25 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,25 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression
* IndexBy ::= "INDEX" "BY" SimpleStateFieldPathExpression
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
class
IndexBy
extends
Node
{
{
p
rotected
$_
simpleStateFieldPathExpression
=
null
;
p
ublic
$
simpleStateFieldPathExpression
=
null
;
public
function
__construct
(
$simpleStateFieldPathExpression
)
public
function
__construct
(
$simpleStateFieldPathExpression
)
{
{
$this
->
_simpleStateFieldPathExpression
=
$simpleStateFieldPathExpression
;
$this
->
simpleStateFieldPathExpression
=
$simpleStateFieldPathExpression
;
}
/* Getters */
public
function
getSimpleStateFieldPathExpression
()
{
return
$this
->
_simpleStateFieldPathExpression
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/InputParameter.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,13 +24,18 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,13 +24,18 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* Description of InputParameter
* 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
class
InputParameter
extends
Node
{
{
private
$_isNamed
;
public
$isNamed
;
private
$_position
;
public
$name
;
private
$_name
;
public
function
__construct
(
$value
)
public
function
__construct
(
$value
)
{
{
...
@@ -24,32 +44,8 @@ class InputParameter extends Node
...
@@ -24,32 +44,8 @@ class InputParameter extends Node
}
}
$param
=
substr
(
$value
,
1
);
$param
=
substr
(
$value
,
1
);
$this
->
_isNamed
=
!
is_numeric
(
$param
);
$this
->
isNamed
=
!
is_numeric
(
$param
);
if
(
$this
->
_isNamed
)
{
$this
->
name
=
$param
;
$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
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/Join.php
View file @
33fc28ff
...
@@ -25,11 +25,13 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -25,11 +25,13 @@ namespace Doctrine\ORM\Query\AST;
* Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression
* Join ::= ["LEFT" ["OUTER"] | "INNER"] "JOIN" JoinAssociationPathExpression
* ["AS"] AliasIdentificationVariable [("ON" | "WITH") ConditionalExpression]
* ["AS"] AliasIdentificationVariable [("ON" | "WITH") ConditionalExpression]
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @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
class
Join
extends
Node
{
{
...
@@ -39,55 +41,17 @@ class Join extends Node
...
@@ -39,55 +41,17 @@ class Join extends Node
const
JOIN_WHERE_ON
=
1
;
const
JOIN_WHERE_ON
=
1
;
const
JOIN_WHERE_WITH
=
2
;
const
JOIN_WHERE_WITH
=
2
;
p
rotected
$_
joinType
=
self
::
JOIN_TYPE_INNER
;
p
ublic
$
joinType
=
self
::
JOIN_TYPE_INNER
;
p
rotected
$_
joinAssociationPathExpression
=
null
;
p
ublic
$
joinAssociationPathExpression
=
null
;
p
rotected
$_
aliasIdentificationVariable
=
null
;
p
ublic
$
aliasIdentificationVariable
=
null
;
p
rotected
$_
whereType
=
self
::
JOIN_WHERE_WITH
;
p
ublic
$
whereType
=
self
::
JOIN_WHERE_WITH
;
p
rotected
$_
conditionalExpression
=
null
;
p
ublic
$
conditionalExpression
=
null
;
public
function
__construct
(
$joinType
,
$joinAssocPathExpr
,
$aliasIdentVar
)
public
function
__construct
(
$joinType
,
$joinAssocPathExpr
,
$aliasIdentVar
)
{
{
$this
->
_joinType
=
$joinType
;
$this
->
joinType
=
$joinType
;
$this
->
_joinAssociationPathExpression
=
$joinAssocPathExpr
;
$this
->
joinAssociationPathExpression
=
$joinAssocPathExpr
;
$this
->
_aliasIdentificationVariable
=
$aliasIdentVar
;
$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
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/JoinAssociationPathExpression.php
View file @
33fc28ff
<?php
<?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
;
namespace
Doctrine\ORM\Query\AST
;
/**
/**
* JoinAssociationPathExpression ::= IdentificationVariable "." (SingleValuedAssociationField | CollectionValuedAssociationField)
* 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 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
class
JoinAssociationPathExpression
extends
Node
{
{
private
$_identificationVariable
;
public
$identificationVariable
;
private
$_assocField
;
public
$associationField
;
public
function
__construct
(
$identificationVariable
,
$assocField
)
{
$this
->
_identificationVariable
=
$identificationVariable
;
$this
->
_assocField
=
$assocField
;
}
public
function
getIdentificationVariable
()
{
return
$this
->
_identificationVariable
;
}
public
function
getAssociationField
(
)
public
function
__construct
(
$identificationVariable
,
$associationField
)
{
{
return
$this
->
_assocField
;
$this
->
identificationVariable
=
$identificationVariable
;
$this
->
associationField
=
$associationField
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/JoinVariableDeclaration.php
View file @
33fc28ff
...
@@ -24,32 +24,23 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,32 +24,23 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* JoinVariableDeclaration ::= Join [IndexBy]
* JoinVariableDeclaration ::= Join [IndexBy]
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @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
class
JoinVariableDeclaration
extends
Node
{
{
p
rotected
$_
join
=
null
;
p
ublic
$
join
=
null
;
p
rotected
$_
indexBy
=
null
;
p
ublic
$
indexBy
=
null
;
public
function
__construct
(
$join
,
$indexBy
)
public
function
__construct
(
$join
,
$indexBy
)
{
{
$this
->
_join
=
$join
;
$this
->
join
=
$join
;
$this
->
_indexBy
=
$indexBy
;
$this
->
indexBy
=
$indexBy
;
}
/* Getters */
public
function
getJoin
()
{
return
$this
->
_join
;
}
public
function
getIndexBy
()
{
return
$this
->
_indexBy
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/LikeExpression.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,41 +24,26 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,41 +24,26 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* LikeExpression ::= StringExpression ["NOT"] "LIKE" string ["ESCAPE" char]
* 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
class
LikeExpression
extends
Node
{
{
private
$_stringExpr
;
public
$not
;
private
$_isNot
;
public
$stringExpression
;
private
$_stringPattern
;
public
$stringPattern
;
private
$_escapeChar
;
public
$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
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
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/Node.php
View file @
33fc28ff
...
@@ -24,13 +24,13 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,13 +24,13 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* Abstract class of an AST node
* 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
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
abstract
class
Node
{
{
...
...
lib/Doctrine/ORM/Query/AST/NullComparisonExpression.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,31 +24,22 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,31 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* NullComparisonExpression ::= (SingleValuedPathExpression | InputParameter) "IS" ["NOT"] "NULL"
* 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
class
NullComparisonExpression
extends
Node
{
{
p
rivate
$_expression
;
p
ublic
$not
;
p
rivate
$_not
;
p
ublic
$expression
;
public
function
__construct
(
$expression
)
public
function
__construct
(
$expression
)
{
{
$this
->
_expression
=
$expression
;
$this
->
expression
=
$expression
;
}
public
function
getExpression
()
{
return
$this
->
_expression
;
}
public
function
setNot
(
$bool
)
{
$this
->
_not
=
$bool
;
}
public
function
isNot
()
{
return
$this
->
_not
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/OrderByClause.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* OrderByClause ::= "ORDER" "BY" OrderByItem {"," OrderByItem}*
* 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
class
OrderByClause
extends
Node
{
{
p
rivate
$_
orderByItems
=
array
();
p
ublic
$
orderByItems
=
array
();
public
function
__construct
(
array
$orderByItems
)
public
function
__construct
(
array
$orderByItems
)
{
{
$this
->
_orderByItems
=
$orderByItems
;
$this
->
orderByItems
=
$orderByItems
;
}
public
function
getOrderByItems
()
{
return
$this
->
_orderByItems
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/OrderByItem.php
View file @
33fc28ff
...
@@ -22,48 +22,34 @@
...
@@ -22,48 +22,34 @@
namespace
Doctrine\ORM\Query\AST
;
namespace
Doctrine\ORM\Query\AST
;
/**
/**
* AST node for the following grammar rule:
*
* OrderByItem ::= (ResultVariable | StateFieldPathExpression) ["ASC" | "DESC"]
* 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 Guilherme Blanco <guilhermeblanco@hotmail.com>
* @author Jonathan Wage <jonwage@gmail.com>
* @author Roman Borschel <roman@code-factory.org>
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
*/
class
OrderByItem
extends
Node
class
OrderByItem
extends
Node
{
{
private
$_expr
;
public
$expression
;
private
$_asc
;
public
$type
;
private
$_desc
;
public
function
__construct
(
$expr
)
{
$this
->
_expr
=
$expr
;
}
public
function
getExpression
(
)
public
function
__construct
(
$expression
)
{
{
return
$this
->
_expr
;
$this
->
expression
=
$expression
;
}
public
function
setAsc
(
$bool
)
{
$this
->
_asc
=
$bool
;
}
}
public
function
isAsc
()
public
function
isAsc
()
{
{
return
$this
->
_asc
;
return
strtoupper
(
$this
->
type
)
==
'ASC'
;
}
public
function
setDesc
(
$bool
)
{
$this
->
_desc
=
$bool
;
}
}
public
function
isDesc
()
public
function
isDesc
()
{
{
return
$this
->
_desc
;
return
strtoupper
(
$this
->
type
)
==
'DESC'
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/PathExpression.php
View file @
33fc28ff
<?php
<?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
;
namespace
Doctrine\ORM\Query\AST
;
/**
/**
* AST node for the following path expressions:
*
* AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
* AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression
*
* SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
* SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression
*
* StateFieldPathExpression ::= SimpleStateFieldPathExpression | SimpleStateFieldAssociationPathExpression
* StateFieldPathExpression ::= SimpleStateFieldPathExpression | SimpleStateFieldAssociationPathExpression
*
* SingleValuedAssociationPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* SingleValuedAssociationField
* SingleValuedAssociationPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* SingleValuedAssociationField
*
* CollectionValuedPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* CollectionValuedAssociationField
* CollectionValuedPathExpression ::= IdentificationVariable "." {SingleValuedAssociationField "."}* CollectionValuedAssociationField
*
* StateField ::= {EmbeddedClassStateField "."}* SimpleStateField
* StateField ::= {EmbeddedClassStateField "."}* SimpleStateField
*
* SimpleStateFieldPathExpression ::= IdentificationVariable "." StateField
* SimpleStateFieldPathExpression ::= IdentificationVariable "." StateField
*
* SimpleStateFieldAssociationPathExpression ::= SingleValuedAssociationPathExpression "." 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
* @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
class
PathExpression
extends
Node
{
{
...
@@ -30,54 +45,21 @@ class PathExpression extends Node
...
@@ -30,54 +45,21 @@ class PathExpression extends Node
const
TYPE_SINGLE_VALUED_ASSOCIATION
=
4
;
const
TYPE_SINGLE_VALUED_ASSOCIATION
=
4
;
const
TYPE_STATE_FIELD
=
8
;
const
TYPE_STATE_FIELD
=
8
;
p
rivate
$_
type
;
p
ublic
$
type
;
p
rivate
$_
expectedType
;
p
ublic
$
expectedType
;
p
rivate
$_
identificationVariable
;
p
ublic
$
identificationVariable
;
p
rivate
$_
parts
;
p
ublic
$
parts
;
public
function
__construct
(
$expectedType
,
$identificationVariable
,
array
$parts
)
public
function
__construct
(
$expectedType
,
$identificationVariable
,
array
$parts
)
{
{
$this
->
_expectedType
=
$expectedType
;
$this
->
expectedType
=
$expectedType
;
$this
->
_identificationVariable
=
$identificationVariable
;
$this
->
identificationVariable
=
$identificationVariable
;
$this
->
_parts
=
$parts
;
$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
;
}
}
public
function
dispatch
(
$walker
)
public
function
dispatch
(
$walker
)
{
{
switch
(
$this
->
_
type
)
{
switch
(
$this
->
type
)
{
case
self
::
TYPE_STATE_FIELD
:
case
self
::
TYPE_STATE_FIELD
:
return
$walker
->
walkStateFieldPathExpression
(
$this
);
return
$walker
->
walkStateFieldPathExpression
(
$this
);
case
self
::
TYPE_SINGLE_VALUED_ASSOCIATION
:
case
self
::
TYPE_SINGLE_VALUED_ASSOCIATION
:
...
...
lib/Doctrine/ORM/Query/AST/QuantifiedExpression.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,18 +24,22 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,18 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* QuantifiedExpression ::= ("ALL" | "ANY" | "SOME") "(" Subselect ")"
* 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
class
QuantifiedExpression
extends
Node
{
{
private
$_all
;
public
$type
;
private
$_any
;
public
$subselect
;
private
$_some
;
private
$_subselect
;
public
function
__construct
(
$subselect
)
public
function
__construct
(
$subselect
)
{
{
$this
->
_
subselect
=
$subselect
;
$this
->
subselect
=
$subselect
;
}
}
public
function
getSubselect
()
public
function
getSubselect
()
...
@@ -30,32 +49,17 @@ class QuantifiedExpression extends Node
...
@@ -30,32 +49,17 @@ class QuantifiedExpression extends Node
public
function
isAll
()
public
function
isAll
()
{
{
return
$this
->
_all
;
return
strtoupper
(
$this
->
type
)
==
'ALL'
;
}
}
public
function
isAny
()
public
function
isAny
()
{
{
return
$this
->
_any
;
return
strtoupper
(
$this
->
type
)
==
'ANY'
;
}
}
public
function
isSome
()
public
function
isSome
()
{
{
return
$this
->
_some
;
return
strtoupper
(
$this
->
type
)
==
'SOME'
;
}
public
function
setAll
(
$bool
)
{
$this
->
_all
=
$bool
;
}
public
function
setAny
(
$bool
)
{
$this
->
_any
=
$bool
;
}
public
function
setSome
(
$bool
)
{
$this
->
_some
=
$bool
;
}
}
/**
/**
...
...
lib/Doctrine/ORM/Query/AST/RangeVariableDeclaration.php
View file @
33fc28ff
...
@@ -24,39 +24,25 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,39 +24,25 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
* RangeVariableDeclaration ::= AbstractSchemaName ["AS"] AliasIdentificationVariable
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
class
RangeVariableDeclaration
extends
Node
{
{
p
rivate
$_
classMetadata
;
p
ublic
$
classMetadata
;
p
rivate
$_
abstractSchemaName
;
p
ublic
$
abstractSchemaName
;
p
rivate
$_
aliasIdentificationVariable
;
p
ublic
$
aliasIdentificationVariable
;
public
function
__construct
(
$classMetadata
,
$aliasIdentificationVar
)
public
function
__construct
(
$classMetadata
,
$aliasIdentificationVar
)
{
{
$this
->
_classMetadata
=
$classMetadata
;
$this
->
classMetadata
=
$classMetadata
;
$this
->
_abstractSchemaName
=
$classMetadata
->
name
;
$this
->
abstractSchemaName
=
$classMetadata
->
name
;
$this
->
_aliasIdentificationVariable
=
$aliasIdentificationVar
;
$this
->
aliasIdentificationVariable
=
$aliasIdentificationVar
;
}
/* Getters */
public
function
getAbstractSchemaName
()
{
return
$this
->
_abstractSchemaName
;
}
public
function
getAliasIdentificationVariable
()
{
return
$this
->
_aliasIdentificationVariable
;
}
public
function
getClassMetadata
()
{
return
$this
->
_classMetadata
;
}
}
public
function
dispatch
(
$walker
)
public
function
dispatch
(
$walker
)
...
...
lib/Doctrine/ORM/Query/AST/SelectClause.php
View file @
33fc28ff
...
@@ -24,50 +24,23 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,50 +24,23 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* SelectClause = "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
* SelectClause = "SELECT" ["DISTINCT"] SelectExpression {"," SelectExpression}
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
class
SelectClause
extends
Node
{
{
protected
$_isDistinct
;
public
$isDistinct
;
public
$selectExpressions
=
array
();
protected
$_selectExpressions
=
array
();
public
function
__construct
(
array
$selectExpressions
,
$isDistinct
)
public
function
__construct
(
array
$selectExpressions
,
$isDistinct
)
{
{
$this
->
_isDistinct
=
$isDistinct
;
$this
->
isDistinct
=
$isDistinct
;
$this
->
_selectExpressions
=
$selectExpressions
;
$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
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SelectExpression.php
View file @
33fc28ff
...
@@ -25,32 +25,23 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -25,32 +25,23 @@ namespace Doctrine\ORM\Query\AST;
* SelectExpression ::= IdentificationVariable ["." "*"] | StateFieldPathExpression |
* SelectExpression ::= IdentificationVariable ["." "*"] | StateFieldPathExpression |
* (AggregateExpression | "(" Subselect ")") [["AS"] FieldAliasIdentificationVariable]
* (AggregateExpression | "(" Subselect ")") [["AS"] FieldAliasIdentificationVariable]
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @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
class
SelectExpression
extends
Node
{
{
p
rotected
$_
expression
;
p
ublic
$
expression
;
p
rotected
$_
fieldIdentificationVariable
;
p
ublic
$
fieldIdentificationVariable
;
public
function
__construct
(
$expression
,
$fieldIdentificationVariable
)
public
function
__construct
(
$expression
,
$fieldIdentificationVariable
)
{
{
$this
->
_expression
=
$expression
;
$this
->
expression
=
$expression
;
$this
->
_fieldIdentificationVariable
=
$fieldIdentificationVariable
;
$this
->
fieldIdentificationVariable
=
$fieldIdentificationVariable
;
}
/* Getters */
public
function
getExpression
()
{
return
$this
->
_expression
;
}
public
function
getFieldIdentificationVariable
()
{
return
$this
->
_fieldIdentificationVariable
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SelectStatement.php
View file @
33fc28ff
...
@@ -24,60 +24,26 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,60 +24,26 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* SelectStatement = SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
* SelectStatement = SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://www.phpdoctrine
.org
* @link
www.doctrine-project
.org
* @since 2.0
* @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
class
SelectStatement
extends
Node
{
{
protected
$_selectClause
;
public
$selectClause
;
protected
$_fromClause
;
public
$fromClause
;
protected
$_whereClause
;
public
$whereClause
;
protected
$_groupByClause
;
public
$groupByClause
;
protected
$_havingClause
;
public
$havingClause
;
protected
$_orderByClause
;
public
$orderByClause
;
public
function
__construct
(
$selectClause
,
$fromClause
,
$whereClause
,
$groupByClause
,
public
function
__construct
(
$selectClause
,
$fromClause
)
{
$havingClause
,
$orderByClause
)
{
$this
->
selectClause
=
$selectClause
;
$this
->
_selectClause
=
$selectClause
;
$this
->
fromClause
=
$fromClause
;
$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
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SimpleArithmeticExpression.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,20 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
* 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
class
SimpleArithmeticExpression
extends
Node
{
{
p
rivate
$_terms
;
p
ublic
$arithmeticTerms
=
array
()
;
public
function
__construct
(
array
$arithmeticTerms
)
public
function
__construct
(
array
$arithmeticTerms
)
{
{
$this
->
_terms
=
$arithmeticTerms
;
$this
->
arithmeticTerms
=
$arithmeticTerms
;
}
public
function
getArithmeticTerms
()
{
return
$this
->
_terms
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SimpleSelectClause.php
View file @
33fc28ff
...
@@ -24,36 +24,23 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,36 +24,23 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
* SimpleSelectClause ::= "SELECT" ["DISTINCT"] SimpleSelectExpression
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
class
SimpleSelectClause
extends
Node
{
{
private
$_isDistinct
=
false
;
public
$isDistinct
=
false
;
private
$_simpleSelectExpression
;
public
$simpleSelectExpression
;
public
function
__construct
(
$simpleSelectExpression
)
{
$this
->
_simpleSelectExpression
=
$simpleSelectExpression
;
}
/* Getters */
public
function
isDistinct
()
{
return
$this
->
_isDistinct
;
}
public
function
setDistinct
(
$bool
)
{
$this
->
_isDistinct
=
$bool
;
}
public
function
getSimpleSelectExpression
(
)
public
function
__construct
(
$simpleSelectExpression
,
$isDistinct
)
{
{
return
$this
->
_simpleSelectExpression
;
$this
->
simpleSelectExpression
=
$simpleSelectExpression
;
$this
->
isDistinct
=
$isDistinct
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php
View file @
33fc28ff
...
@@ -25,35 +25,22 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -25,35 +25,22 @@ namespace Doctrine\ORM\Query\AST;
* SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable
* SimpleSelectExpression ::= StateFieldPathExpression | IdentificationVariable
* | (AggregateExpression [["AS"] FieldAliasIdentificationVariable])
* | (AggregateExpression [["AS"] FieldAliasIdentificationVariable])
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
class
SimpleSelectExpression
extends
Node
{
{
p
rivate
$_
expression
;
p
ublic
$
expression
;
p
rivate
$_
fieldIdentificationVariable
;
p
ublic
$
fieldIdentificationVariable
;
public
function
__construct
(
$expression
)
public
function
__construct
(
$expression
)
{
{
$this
->
_expression
=
$expression
;
$this
->
expression
=
$expression
;
}
public
function
getExpression
()
{
return
$this
->
_expression
;
}
public
function
getFieldIdentificationVariable
()
{
return
$this
->
_fieldIdentificationVariable
;
}
public
function
setFieldIdentificationVariable
(
$fieldAlias
)
{
$this
->
_fieldIdentificationVariable
=
$fieldAlias
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/Subselect.php
View file @
33fc28ff
...
@@ -24,76 +24,27 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,76 +24,27 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
* Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause]
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
class
Subselect
extends
Node
{
{
p
rivate
$_
simpleSelectClause
;
p
ublic
$
simpleSelectClause
;
p
rivate
$_
subselectFromClause
;
p
ublic
$
subselectFromClause
;
p
rivate
$_
whereClause
;
p
ublic
$
whereClause
;
p
rivate
$_
groupByClause
;
p
ublic
$
groupByClause
;
p
rivate
$_
havingClause
;
p
ublic
$
havingClause
;
p
rivate
$_
orderByClause
;
p
ublic
$
orderByClause
;
public
function
__construct
(
$simpleSelectClause
,
$subselectFromClause
)
public
function
__construct
(
$simpleSelectClause
,
$subselectFromClause
)
{
{
$this
->
_simpleSelectClause
=
$simpleSelectClause
;
$this
->
simpleSelectClause
=
$simpleSelectClause
;
$this
->
_subselectFromClause
=
$subselectFromClause
;
$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
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/SubselectFromClause.php
View file @
33fc28ff
...
@@ -24,25 +24,21 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,25 +24,21 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
* SubselectFromClause ::= "FROM" SubselectIdentificationVariableDeclaration {"," SubselectIdentificationVariableDeclaration}*
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
class
SubselectFromClause
extends
Node
{
{
p
rivate
$_
identificationVariableDeclarations
=
array
();
p
ublic
$
identificationVariableDeclarations
=
array
();
public
function
__construct
(
array
$identificationVariableDeclarations
)
public
function
__construct
(
array
$identificationVariableDeclarations
)
{
{
$this
->
_identificationVariableDeclarations
=
$identificationVariableDeclarations
;
$this
->
identificationVariableDeclarations
=
$identificationVariableDeclarations
;
}
/* Getters */
public
function
getSubselectIdentificationVariableDeclarations
()
{
return
$this
->
_identificationVariableDeclarations
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/UpdateClause.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
namespace
Doctrine\ORM\Query\AST
;
/**
/**
* UpdateClause ::= "UPDATE" AbstractSchemaName [["AS"] AliasIdentificationVariable] "SET" UpdateItem {"," UpdateItem}*
* 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
class
UpdateClause
extends
Node
{
{
p
rivate
$_
abstractSchemaName
;
p
ublic
$
abstractSchemaName
;
p
rivate
$_
aliasIdentificationVariable
;
p
ublic
$
aliasIdentificationVariable
;
p
rivate
$_
updateItems
=
array
();
p
ublic
$
updateItems
=
array
();
public
function
__construct
(
$abstractSchemaName
,
array
$updateItems
)
public
function
__construct
(
$abstractSchemaName
,
array
$updateItems
)
{
{
$this
->
_abstractSchemaName
=
$abstractSchemaName
;
$this
->
abstractSchemaName
=
$abstractSchemaName
;
$this
->
_updateItems
=
$updateItems
;
$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
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/UpdateItem.php
View file @
33fc28ff
...
@@ -26,39 +26,24 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -26,39 +26,24 @@ namespace Doctrine\ORM\Query\AST;
* NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary |
* NewValue ::= SimpleArithmeticExpression | StringPrimary | DatetimePrimary | BooleanPrimary |
* EnumPrimary | SimpleEntityExpression | "NULL"
* 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
* @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
class
UpdateItem
extends
Node
{
{
p
rivate
$_
identificationVariable
;
p
ublic
$
identificationVariable
;
p
rivate
$_
field
;
p
ublic
$
field
;
p
rivate
$_
newValue
;
p
ublic
$
newValue
;
public
function
__construct
(
$field
,
$newValue
)
public
function
__construct
(
$field
,
$newValue
)
{
{
$this
->
_field
=
$field
;
$this
->
field
=
$field
;
$this
->
_newValue
=
$newValue
;
$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
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/UpdateStatement.php
View file @
33fc28ff
...
@@ -24,35 +24,22 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,35 +24,22 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* UpdateStatement = UpdateClause [WhereClause]
* UpdateStatement = UpdateClause [WhereClause]
*
*
* @author Guilherme Blanco <guilhermeblanco@hotmail.com>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @link
http://
www.doctrine-project.org
* @link www.doctrine-project.org
* @since 2.0
* @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
class
UpdateStatement
extends
Node
{
{
p
rivate
$_
updateClause
;
p
ublic
$
updateClause
;
p
rivate
$_
whereClause
;
p
ublic
$
whereClause
;
public
function
__construct
(
$updateClause
)
public
function
__construct
(
$updateClause
)
{
{
$this
->
_updateClause
=
$updateClause
;
$this
->
updateClause
=
$updateClause
;
}
public
function
setWhereClause
(
$whereClause
)
{
$this
->
_whereClause
=
$whereClause
;
}
public
function
getUpdateClause
()
{
return
$this
->
_updateClause
;
}
public
function
getWhereClause
()
{
return
$this
->
_whereClause
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/AST/WhereClause.php
View file @
33fc28ff
<?php
<?php
/*
/*
* To change this template, choose Tools | Templates
* $Id$
* and open the template in the editor.
*
* 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
;
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
class
WhereClause
extends
Node
{
{
p
rivate
$_
conditionalExpression
;
p
ublic
$
conditionalExpression
;
public
function
__construct
(
$conditionalExpression
)
public
function
__construct
(
$conditionalExpression
)
{
{
$this
->
_conditionalExpression
=
$conditionalExpression
;
$this
->
conditionalExpression
=
$conditionalExpression
;
}
public
function
getConditionalExpression
()
{
return
$this
->
_conditionalExpression
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php
View file @
33fc28ff
...
@@ -53,9 +53,9 @@ class MultiTableDeleteExecutor extends AbstractSqlExecutor
...
@@ -53,9 +53,9 @@ class MultiTableDeleteExecutor extends AbstractSqlExecutor
$conn
=
$em
->
getConnection
();
$conn
=
$em
->
getConnection
();
$primaryClass
=
$sqlWalker
->
getEntityManager
()
->
getClassMetadata
(
$primaryClass
=
$sqlWalker
->
getEntityManager
()
->
getClassMetadata
(
$AST
->
getDeleteClause
()
->
getAbstractSchemaName
()
$AST
->
deleteClause
->
abstractSchemaName
);
);
$primaryDqlAlias
=
$AST
->
getDeleteClause
()
->
getAliasIdentificationVariable
()
;
$primaryDqlAlias
=
$AST
->
deleteClause
->
aliasIdentificationVariable
;
$rootClass
=
$em
->
getClassMetadata
(
$primaryClass
->
rootEntityName
);
$rootClass
=
$em
->
getClassMetadata
(
$primaryClass
->
rootEntityName
);
$tempTable
=
$rootClass
->
getTemporaryIdTableName
();
$tempTable
=
$rootClass
->
getTemporaryIdTableName
();
...
@@ -71,8 +71,8 @@ class MultiTableDeleteExecutor extends AbstractSqlExecutor
...
@@ -71,8 +71,8 @@ class MultiTableDeleteExecutor extends AbstractSqlExecutor
$this
->
_insertSql
.=
$sqlWalker
->
walkFromClause
(
$fromClause
);
$this
->
_insertSql
.=
$sqlWalker
->
walkFromClause
(
$fromClause
);
// Append WHERE clause, if there is one.
// Append WHERE clause, if there is one.
if
(
$AST
->
getWhereClause
()
)
{
if
(
$AST
->
whereClause
)
{
$this
->
_insertSql
.=
$sqlWalker
->
walkWhereClause
(
$AST
->
getWhereClause
()
);
$this
->
_insertSql
.=
$sqlWalker
->
walkWhereClause
(
$AST
->
whereClause
);
}
}
// 2. Create ID subselect statement used in DELETE .... WHERE ... IN (subselect)
// 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
...
@@ -53,13 +53,12 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
{
{
$em
=
$sqlWalker
->
getEntityManager
();
$em
=
$sqlWalker
->
getEntityManager
();
$conn
=
$em
->
getConnection
();
$conn
=
$em
->
getConnection
();
$updateClause
=
$AST
->
updateClause
;
$primaryClass
=
$sqlWalker
->
getEntityManager
()
->
getClassMetadata
(
$primaryClass
=
$sqlWalker
->
getEntityManager
()
->
getClassMetadata
(
$updateClause
->
abstractSchemaName
);
$AST
->
getUpdateClause
()
->
getAbstractSchemaName
()
);
$rootClass
=
$em
->
getClassMetadata
(
$primaryClass
->
rootEntityName
);
$rootClass
=
$em
->
getClassMetadata
(
$primaryClass
->
rootEntityName
);
$updateItems
=
$
AST
->
getUpdateClause
()
->
getUpdateItems
()
;
$updateItems
=
$
updateClause
->
updateItems
;
$tempTable
=
$rootClass
->
getTemporaryIdTableName
();
$tempTable
=
$rootClass
->
getTemporaryIdTableName
();
$idColumnNames
=
$rootClass
->
getIdentifierColumnNames
();
$idColumnNames
=
$rootClass
->
getIdentifierColumnNames
();
...
@@ -68,8 +67,8 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
...
@@ -68,8 +67,8 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
// 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause()
// 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause()
$this
->
_insertSql
=
'INSERT INTO '
.
$tempTable
.
' ('
.
$idColumnList
.
')'
$this
->
_insertSql
=
'INSERT INTO '
.
$tempTable
.
' ('
.
$idColumnList
.
')'
.
' SELECT t0.'
.
implode
(
', t0.'
,
$idColumnNames
);
.
' SELECT t0.'
.
implode
(
', t0.'
,
$idColumnNames
);
$sqlWalker
->
setSqlTableAlias
(
$primaryClass
->
primaryTable
[
'name'
]
.
$
AST
->
getUpdateClause
()
->
getAliasIdentificationVariable
()
,
't0'
);
$sqlWalker
->
setSqlTableAlias
(
$primaryClass
->
primaryTable
[
'name'
]
.
$
updateClause
->
aliasIdentificationVariable
,
't0'
);
$rangeDecl
=
new
AST\RangeVariableDeclaration
(
$primaryClass
,
$
AST
->
getUpdateClause
()
->
getAliasIdentificationVariable
()
);
$rangeDecl
=
new
AST\RangeVariableDeclaration
(
$primaryClass
,
$
updateClause
->
aliasIdentificationVariable
);
$fromClause
=
new
AST\FromClause
(
array
(
new
AST\IdentificationVariableDeclaration
(
$rangeDecl
,
null
,
array
())));
$fromClause
=
new
AST\FromClause
(
array
(
new
AST\IdentificationVariableDeclaration
(
$rangeDecl
,
null
,
array
())));
$this
->
_insertSql
.=
$sqlWalker
->
walkFromClause
(
$fromClause
);
$this
->
_insertSql
.=
$sqlWalker
->
walkFromClause
(
$fromClause
);
...
@@ -79,6 +78,7 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
...
@@ -79,6 +78,7 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
// 3. Create and store UPDATE statements
// 3. Create and store UPDATE statements
$classNames
=
array_merge
(
$primaryClass
->
parentClasses
,
array
(
$primaryClass
->
name
),
$primaryClass
->
subClasses
);
$classNames
=
array_merge
(
$primaryClass
->
parentClasses
,
array
(
$primaryClass
->
name
),
$primaryClass
->
subClasses
);
$i
=
-
1
;
$i
=
-
1
;
foreach
(
array_reverse
(
$classNames
)
as
$className
)
{
foreach
(
array_reverse
(
$classNames
)
as
$className
)
{
$affected
=
false
;
$affected
=
false
;
$class
=
$em
->
getClassMetadata
(
$className
);
$class
=
$em
->
getClassMetadata
(
$className
);
...
@@ -86,19 +86,22 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
...
@@ -86,19 +86,22 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
$updateSql
=
'UPDATE '
.
$conn
->
quoteIdentifier
(
$tableName
)
.
' SET '
;
$updateSql
=
'UPDATE '
.
$conn
->
quoteIdentifier
(
$tableName
)
.
' SET '
;
foreach
(
$updateItems
as
$updateItem
)
{
foreach
(
$updateItems
as
$updateItem
)
{
$field
=
$updateItem
->
getField
()
;
$field
=
$updateItem
->
field
;
if
(
isset
(
$class
->
fieldMappings
[
$field
])
&&
!
isset
(
$class
->
fieldMappings
[
$field
][
'inherited'
]))
{
if
(
isset
(
$class
->
fieldMappings
[
$field
])
&&
!
isset
(
$class
->
fieldMappings
[
$field
][
'inherited'
]))
{
$newValue
=
$updateItem
->
getNewValue
();
$newValue
=
$updateItem
->
newValue
;
if
(
!
$affected
)
{
if
(
!
$affected
)
{
$affected
=
true
;
$affected
=
true
;
++
$i
;
++
$i
;
}
else
{
}
else
{
$updateSql
.=
', '
;
$updateSql
.=
', '
;
}
}
$updateSql
.=
$sqlWalker
->
walkUpdateItem
(
$updateItem
);
$updateSql
.=
$sqlWalker
->
walkUpdateItem
(
$updateItem
);
//FIXME: parameters can be more deeply nested. traverse the tree.
//FIXME: parameters can be more deeply nested. traverse the tree.
if
(
$newValue
instanceof
AST\InputParameter
)
{
if
(
$newValue
instanceof
AST\InputParameter
)
{
$paramKey
=
$newValue
->
isNamed
()
?
$newValue
->
getName
()
:
$newValue
->
getPosition
()
;
$paramKey
=
$newValue
->
name
;
$this
->
_sqlParameters
[
$i
][]
=
$sqlWalker
->
getQuery
()
->
getParameter
(
$paramKey
);
$this
->
_sqlParameters
[
$i
][]
=
$sqlWalker
->
getQuery
()
->
getParameter
(
$paramKey
);
++
$this
->
_numParametersInUpdateClause
;
++
$this
->
_numParametersInUpdateClause
;
}
}
...
@@ -111,8 +114,8 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
...
@@ -111,8 +114,8 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor
}
}
// Append WHERE clause to insertSql, if there is one.
// Append WHERE clause to insertSql, if there is one.
if
(
$AST
->
getWhereClause
()
)
{
if
(
$AST
->
whereClause
)
{
$this
->
_insertSql
.=
$sqlWalker
->
walkWhereClause
(
$AST
->
getWhereClause
()
);
$this
->
_insertSql
.=
$sqlWalker
->
walkWhereClause
(
$AST
->
whereClause
);
}
}
// 4. Store DDL for temporary identifier table.
// 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