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
175d3307
Commit
175d3307
authored
Nov 08, 2007
by
phuson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed ticket #571
parent
ee9e79d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
+24
-19
Query.php
lib/Doctrine/Query.php
+24
-19
No files found.
lib/Doctrine/Query.php
View file @
175d3307
...
...
@@ -969,38 +969,43 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
$q
.=
$part
;
continue
;
}
// preserve LEFT JOINs only if needed
// Check if it's JOIN, if not add a comma separator instead of space
if
(
!
preg_match
(
'/\bJOIN\b/i'
,
$part
)
&&
!
isset
(
$this
->
_pendingJoinConditions
[
$k
]))
{
$q
.=
', '
.
$part
;
}
else
{
if
(
substr
(
$part
,
0
,
9
)
===
'LEFT JOIN'
)
{
$e
=
explode
(
' '
,
$part
);
if
(
substr
(
$part
,
0
,
9
)
===
'LEFT JOIN'
)
{
$e
=
explode
(
' '
,
$part
);
$aliases
=
array_merge
(
$this
->
subqueryAliases
,
array_keys
(
$this
->
_neededTables
)
);
$aliases
=
array_merge
(
$this
->
subqueryAliases
,
array_keys
(
$this
->
_neededTables
));
if
(
!
in_array
(
$e
[
3
],
$aliases
)
&&
!
in_array
(
$e
[
2
],
$aliases
)
&&
if
(
!
in_array
(
$e
[
3
],
$aliases
)
&&
!
in_array
(
$e
[
2
],
$aliases
)
&&
!
empty
(
$this
->
_pendingFields
))
{
continue
;
}
!
empty
(
$this
->
_pendingFields
))
{
continue
;
}
}
if
(
isset
(
$this
->
_pendingJoinConditions
[
$k
]))
{
$parser
=
new
Doctrine_Query_JoinCondition
(
$this
);
if
(
isset
(
$this
->
_pendingJoinConditions
[
$k
]))
{
$parser
=
new
Doctrine_Query_JoinCondition
(
$this
);
if
(
strpos
(
$part
,
' ON '
)
!==
false
)
{
$part
.=
' AND '
;
}
else
{
$part
.=
' ON '
;
}
$part
.=
$parser
->
parse
(
$this
->
_pendingJoinConditions
[
$k
]);
if
(
strpos
(
$part
,
' ON '
)
!==
false
)
{
$part
.=
' AND '
;
}
else
{
$part
.=
' ON '
;
unset
(
$this
->
_pendingJoinConditions
[
$k
]);
}
$part
.=
$parser
->
parse
(
$this
->
_pendingJoinConditions
[
$k
]);
unset
(
$this
->
_pendingJoinConditions
[
$k
])
;
$q
.=
' '
.
$part
;
}
$q
.=
' '
.
$part
;
$this
->
parts
[
'from'
][
$k
]
=
$part
;
}
return
$q
;
...
...
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