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
115cadb0
Commit
115cadb0
authored
Jun 08, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
complete support for DISTINCT keyword
parent
b097669f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
Query.php
lib/Doctrine/Query.php
+10
-0
Abstract.php
lib/Doctrine/Query/Abstract.php
+3
-3
No files found.
lib/Doctrine/Query.php
View file @
115cadb0
...
...
@@ -339,6 +339,15 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
{
$refs
=
Doctrine_Tokenizer
::
bracketExplode
(
$dql
,
','
);
$pos
=
strpos
(
trim
(
$refs
[
0
]),
' '
);
$first
=
substr
(
$refs
[
0
],
0
,
$pos
);
if
(
$first
===
'DISTINCT'
)
{
$this
->
parts
[
'distinct'
]
=
true
;
$refs
[
0
]
=
substr
(
$refs
[
0
],
++
$pos
);
}
foreach
(
$refs
as
$reference
)
{
$reference
=
trim
(
$reference
);
if
(
strpos
(
$reference
,
'('
)
!==
false
)
{
...
...
@@ -350,6 +359,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
}
}
else
{
$e
=
explode
(
'.'
,
$reference
);
if
(
count
(
$e
)
>
2
)
{
$this
->
pendingFields
[]
=
$reference
;
...
...
lib/Doctrine/Query/Abstract.php
View file @
115cadb0
...
...
@@ -118,8 +118,8 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate
* @return Doctrine_Query
*/
public
function
distinct
(
$flag
=
true
)
{
$this
->
_
parts
[
'distinct'
]
=
(
bool
)
$flag
;
{
$this
->
parts
[
'distinct'
]
=
(
bool
)
$flag
;
return
$this
;
}
...
...
@@ -133,7 +133,7 @@ abstract class Doctrine_Query_Abstract extends Doctrine_Hydrate
*/
public
function
forUpdate
(
$flag
=
true
)
{
$this
->
_
parts
[
self
::
FOR_UPDATE
]
=
(
bool
)
$flag
;
$this
->
parts
[
self
::
FOR_UPDATE
]
=
(
bool
)
$flag
;
return
$this
;
}
...
...
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