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
f40601fe
Commit
f40601fe
authored
Oct 12, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #161, DQL : added support for EJB 3 -style JOIN syntax
parent
7c47b785
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
5 deletions
+29
-5
From.php
lib/Doctrine/Query/From.php
+26
-5
run.php
tests/run.php
+3
-0
No files found.
lib/Doctrine/Query/From.php
View file @
f40601fe
...
...
@@ -11,11 +11,32 @@ class Doctrine_Query_From extends Doctrine_Query_Part {
* @return void
*/
final
public
function
parse
(
$str
)
{
foreach
(
Doctrine_Query
::
bracketExplode
(
trim
(
$str
),
","
,
"("
,
")"
)
as
$reference
)
{
$reference
=
trim
(
$reference
);
$a
=
explode
(
"."
,
$reference
);
$field
=
array_pop
(
$a
);
$table
=
$this
->
query
->
load
(
$reference
);
$str
=
trim
(
$str
);
$parts
=
Doctrine_Query
::
bracketExplode
(
$str
,
'JOIN'
);
$operator
=
false
;
$last
=
''
;
foreach
(
$parts
as
$k
=>
$part
)
{
$part
=
trim
(
$part
);
$e
=
explode
(
" "
,
$part
);
if
(
end
(
$e
)
==
'INNER'
||
end
(
$e
)
==
'LEFT'
)
$last
=
array_pop
(
$e
);
$part
=
implode
(
" "
,
$e
);
foreach
(
Doctrine_Query
::
bracketExplode
(
$part
,
','
)
as
$reference
)
{
$reference
=
trim
(
$reference
);
$e
=
explode
(
'.'
,
$reference
);
if
(
$operator
)
{
$reference
=
array_shift
(
$e
)
.
$operator
.
implode
(
'.'
,
$e
);
}
$table
=
$this
->
query
->
load
(
$reference
);
}
$operator
=
(
$last
==
'INNER'
)
?
':'
:
'.'
;
}
}
...
...
tests/run.php
View file @
f40601fe
...
...
@@ -33,6 +33,7 @@ require_once("QueryLimitTestCase.php");
require_once
(
"QueryMultiJoinTestCase.php"
);
require_once
(
"QueryReferenceModelTestCase.php"
);
require_once
(
"QueryWhereTestCase.php"
);
require_once
(
"QueryFromTestCase.php"
);
require_once
(
"QueryConditionTestCase.php"
);
require_once
(
"QueryComponentAliasTestCase.php"
);
require_once
(
"QuerySubqueryTestCase.php"
);
...
...
@@ -126,6 +127,8 @@ $test->addTestCase(new Doctrine_QueryTestCase());
$test
->
addTestCase
(
new
Doctrine_Query_Where_TestCase
());
$test
->
addTestCase
(
new
Doctrine_Query_From_TestCase
());
//$test->addTestCase(new Doctrine_Cache_FileTestCase());
...
...
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