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
531f4a4d
Commit
531f4a4d
authored
May 19, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
5d4b8c45
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
10 deletions
+52
-10
Hydrate.php
lib/Doctrine/Hydrate.php
+0
-2
Query.php
lib/Doctrine/Query.php
+50
-6
RawSql.php
lib/Doctrine/RawSql.php
+2
-2
No files found.
lib/Doctrine/Hydrate.php
View file @
531f4a4d
...
@@ -254,7 +254,6 @@ class Doctrine_Hydrate
...
@@ -254,7 +254,6 @@ class Doctrine_Hydrate
*/
*/
protected
function
clear
()
protected
function
clear
()
{
{
$this
->
tables
=
array
();
$this
->
parts
=
array
(
$this
->
parts
=
array
(
'select'
=>
array
(),
'select'
=>
array
(),
'distinct'
=>
false
,
'distinct'
=>
false
,
...
@@ -270,7 +269,6 @@ class Doctrine_Hydrate
...
@@ -270,7 +269,6 @@ class Doctrine_Hydrate
'offset'
=>
false
,
'offset'
=>
false
,
);
);
$this
->
inheritanceApplied
=
false
;
$this
->
inheritanceApplied
=
false
;
$this
->
tableAliases
=
array
();
$this
->
aliasHandler
->
clear
();
$this
->
aliasHandler
->
clear
();
}
}
/**
/**
...
...
lib/Doctrine/Query.php
View file @
531f4a4d
...
@@ -66,6 +66,23 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
...
@@ -66,6 +66,23 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
* @var array $_enumParams an array containing the keys of the parameters that should be enumerated
* @var array $_enumParams an array containing the keys of the parameters that should be enumerated
*/
*/
protected
$_enumParams
=
array
();
protected
$_enumParams
=
array
();
/**
* @var array $_dqlParts an array containing all DQL query parts
*/
protected
$_dqlParts
=
array
(
'select'
=>
array
(),
'distinct'
=>
false
,
'forUpdate'
=>
false
,
'from'
=>
array
(),
'set'
=>
array
(),
'join'
=>
array
(),
'where'
=>
array
(),
'groupby'
=>
array
(),
'having'
=>
array
(),
'orderby'
=>
array
(),
'limit'
=>
false
,
'offset'
=>
false
,
);
/**
/**
* create
* create
...
@@ -182,7 +199,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
...
@@ -182,7 +199,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
}
}
/**
/**
* parseQueryPart
* parseQueryPart
* parses given query part
* parses given
DQL
query part
*
*
* @param string $queryPartName the name of the query part
* @param string $queryPartName the name of the query part
* @param string $queryPart query part to be parsed
* @param string $queryPart query part to be parsed
...
@@ -193,8 +210,35 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
...
@@ -193,8 +210,35 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
*/
*/
public
function
parseQueryPart
(
$queryPartName
,
$queryPart
,
$append
=
false
)
public
function
parseQueryPart
(
$queryPartName
,
$queryPart
,
$append
=
false
)
{
{
if
(
$append
)
{
$this
->
_dqlParts
[
$queryPartName
][]
=
$queryPart
;
}
else
{
$this
->
_dqlParts
[
$queryPartName
]
=
$queryPart
;
}
return
$this
->
getParser
(
$queryPartName
)
->
parse
(
$queryPart
);
return
$this
->
getParser
(
$queryPartName
)
->
parse
(
$queryPart
);
}
}
/**
* getDql
* returns the DQL query associated with this object
*
* the query is built from $_dqlParts
*
* @return string the DQL query
*/
public
function
getDql
()
{
$q
=
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'select'
]))
?
'SELECT '
.
implode
(
', '
,
$this
->
parts
[
'select'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'from'
]))
?
' FROM '
.
implode
(
' '
,
$this
->
parts
[
'from'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'where'
]))
?
' WHERE '
.
implode
(
' AND '
,
$this
->
parts
[
'where'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'groupby'
]))
?
' GROUP BY '
.
implode
(
', '
,
$this
->
parts
[
'groupby'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'having'
]))
?
' HAVING '
.
implode
(
' AND '
,
$this
->
parts
[
'having'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'orderby'
]))
?
' ORDER BY '
.
implode
(
', '
,
$this
->
parts
[
'orderby'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'limit'
]))
?
' LIMIT '
.
implode
(
' '
,
$this
->
parts
[
'limit'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'offset'
]))
?
' OFFSET '
.
implode
(
' '
,
$this
->
parts
[
'offset'
])
:
''
;
return
$q
;
}
/**
/**
* processPendingFields
* processPendingFields
* the fields in SELECT clause cannot be parsed until the components
* the fields in SELECT clause cannot be parsed until the components
...
...
lib/Doctrine/RawSql.php
View file @
531f4a4d
...
@@ -182,8 +182,8 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
...
@@ -182,8 +182,8 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
$q
.=
(
!
empty
(
$this
->
parts
[
'from'
]))
?
' FROM '
.
implode
(
' '
,
$this
->
parts
[
'from'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'from'
]))
?
' FROM '
.
implode
(
' '
,
$this
->
parts
[
'from'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'where'
]))
?
' WHERE '
.
implode
(
' AND '
,
$this
->
parts
[
'where'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'where'
]))
?
' WHERE '
.
implode
(
' AND '
,
$this
->
parts
[
'where'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'groupby'
]))
?
' GROUP BY '
.
implode
(
', '
,
$this
->
parts
[
'groupby'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'groupby'
]))
?
' GROUP BY '
.
implode
(
', '
,
$this
->
parts
[
'groupby'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'having'
]))
?
' HAVING '
.
implode
(
' '
,
$this
->
parts
[
'having'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'having'
]))
?
' HAVING '
.
implode
(
'
AND
'
,
$this
->
parts
[
'having'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'orderby'
]))
?
' ORDER BY '
.
implode
(
' '
,
$this
->
parts
[
'orderby'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'orderby'
]))
?
' ORDER BY '
.
implode
(
'
,
'
,
$this
->
parts
[
'orderby'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'limit'
]))
?
' LIMIT '
.
implode
(
' '
,
$this
->
parts
[
'limit'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'limit'
]))
?
' LIMIT '
.
implode
(
' '
,
$this
->
parts
[
'limit'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'offset'
]))
?
' OFFSET '
.
implode
(
' '
,
$this
->
parts
[
'offset'
])
:
''
;
$q
.=
(
!
empty
(
$this
->
parts
[
'offset'
]))
?
' OFFSET '
.
implode
(
' '
,
$this
->
parts
[
'offset'
])
:
''
;
...
...
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