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
f087a005
Commit
f087a005
authored
Aug 06, 2009
by
guilhermeblanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Started refactoring of AST nodes to use public properties instead of getter/setter methods
parent
401235d7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
49 deletions
+41
-49
AggregateExpression.php
lib/Doctrine/ORM/Query/AST/AggregateExpression.php
+7
-1
ArithmeticExpression.php
lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php
+29
-34
Parser.php
lib/Doctrine/ORM/Query/Parser.php
+2
-2
SqlWalker.php
lib/Doctrine/ORM/Query/SqlWalker.php
+3
-12
No files found.
lib/Doctrine/ORM/Query/AST/AggregateExpression.php
View file @
f087a005
...
@@ -24,7 +24,13 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -24,7 +24,13 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* Description of AggregateExpression
* Description of AggregateExpression
*
*
* @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
AggregateExpression
extends
Node
class
AggregateExpression
extends
Node
{
{
...
...
lib/Doctrine/ORM/Query/AST/ArithmeticExpression.php
View file @
f087a005
<?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,47 +24,27 @@ namespace Doctrine\ORM\Query\AST;
...
@@ -9,47 +24,27 @@ namespace Doctrine\ORM\Query\AST;
/**
/**
* ArithmeticExpression ::= SimpleArithmeticExpression | "(" Subselect ")"
* ArithmeticExpression ::= SimpleArithmeticExpression | "(" 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
ArithmeticExpression
extends
Node
class
ArithmeticExpression
extends
Node
{
{
private
$_simpleArithmeticExpression
;
public
$simpleArithmeticExpression
;
private
$_subselect
;
public
$subselect
;
public
function
setSimpleArithmeticExpression
(
$simpleArithmeticExpr
)
{
if
(
$this
->
_subselect
)
{
throw
\Doctrine\Common\DoctrineException
::
updateMe
();
}
$this
->
_simpleArithmeticExpression
=
$simpleArithmeticExpr
;
}
public
function
setSubselect
(
$subselect
)
{
if
(
$this
->
_simpleArithmeticExpression
){
throw
\Doctrine\Common\DoctrineException
::
updateMe
();
}
$this
->
_subselect
=
$subselect
;
}
public
function
getSimpleArithmeticExpression
()
{
return
$this
->
_simpleArithmeticExpression
;
}
public
function
getSubselect
()
{
return
$this
->
_subselect
;
}
public
function
isSimpleArithmeticExpression
()
public
function
isSimpleArithmeticExpression
()
{
{
return
(
bool
)
$this
->
_
simpleArithmeticExpression
;
return
(
bool
)
$this
->
simpleArithmeticExpression
;
}
}
public
function
isSubselect
()
public
function
isSubselect
()
{
{
return
(
bool
)
$this
->
_
subselect
;
return
(
bool
)
$this
->
subselect
;
}
}
public
function
dispatch
(
$sqlWalker
)
public
function
dispatch
(
$sqlWalker
)
...
...
lib/Doctrine/ORM/Query/Parser.php
View file @
f087a005
...
@@ -1900,14 +1900,14 @@ class Parser
...
@@ -1900,14 +1900,14 @@ class Parser
if
(
$peek
[
'type'
]
===
Lexer
::
T_SELECT
)
{
if
(
$peek
[
'type'
]
===
Lexer
::
T_SELECT
)
{
$this
->
match
(
'('
);
$this
->
match
(
'('
);
$expr
->
s
etSubselect
(
$this
->
Subselect
()
);
$expr
->
s
ubselect
=
$this
->
Subselect
(
);
$this
->
match
(
')'
);
$this
->
match
(
')'
);
return
$expr
;
return
$expr
;
}
}
}
}
$expr
->
s
etSimpleArithmeticExpression
(
$this
->
SimpleArithmeticExpression
()
);
$expr
->
s
impleArithmeticExpression
=
$this
->
SimpleArithmeticExpression
(
);
return
$expr
;
return
$expr
;
}
}
...
...
lib/Doctrine/ORM/Query/SqlWalker.php
View file @
f087a005
...
@@ -30,7 +30,6 @@ use Doctrine\ORM\Query,
...
@@ -30,7 +30,6 @@ use Doctrine\ORM\Query,
*
*
* @author Roman Borschel <roman@code-factory.org>
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
* @since 2.0
* @todo Code review for identifier quoting.
* @todo Code review for schema usage with table names.
* @todo Code review for schema usage with table names.
* (Prepend schema name to tables IF schema is defined AND platform supports them)
* (Prepend schema name to tables IF schema is defined AND platform supports them)
*/
*/
...
@@ -1272,17 +1271,9 @@ class SqlWalker implements TreeWalker
...
@@ -1272,17 +1271,9 @@ class SqlWalker implements TreeWalker
*/
*/
public
function
walkArithmeticExpression
(
$arithmeticExpr
)
public
function
walkArithmeticExpression
(
$arithmeticExpr
)
{
{
$sql
=
''
;
return
(
$arithmeticExpr
->
isSimpleArithmeticExpression
())
?
$this
->
walkSimpleArithmeticExpression
(
$arithmeticExpr
->
simpleArithmeticExpression
)
if
(
$arithmeticExpr
->
isSimpleArithmeticExpression
())
{
:
$this
->
walkSubselect
(
$arithmeticExpr
->
subselect
);
foreach
(
$arithmeticExpr
->
getSimpleArithmeticExpression
()
->
getArithmeticTerms
()
as
$term
)
{
$sql
.=
$this
->
walkArithmeticTerm
(
$term
);
}
}
else
{
$sql
.=
$this
->
walkSubselect
(
$arithmeticExpr
->
getSubselect
());
}
return
$sql
;
}
}
/**
/**
...
...
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