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
4570b900
Commit
4570b900
authored
Nov 25, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed CTI column referencing within DQL
parent
0cda3678
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
15 deletions
+30
-15
Query.php
lib/Doctrine/Query.php
+30
-15
No files found.
lib/Doctrine/Query.php
View file @
4570b900
...
...
@@ -489,6 +489,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
$fields
=
$this
->
_pendingFields
[
$componentAlias
];
// check for wildcards
if
(
in_array
(
'*'
,
$fields
))
{
//echo "<br />";Doctrine::dump($table->getColumnNames()); echo "<br />";
...
...
@@ -563,9 +564,6 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
return
implode
(
', '
,
$sql
);
}
else
{
}
$name
=
$table
->
getColumnName
(
$field
);
$this
->
_neededTables
[]
=
$tableAlias
;
...
...
@@ -574,6 +572,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
.
' AS '
.
$this
->
_conn
->
quoteIdentifier
(
$tableAlias
.
'__'
.
$name
);
}
}
/**
* getExpressionOwner
...
...
@@ -766,14 +765,20 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
$table
=
$this
->
_queryComponents
[
$componentAlias
][
'table'
];
$def
=
$table
->
getDefinitionOf
(
$field
);
// get the actual field name from alias
$field
=
$table
->
getColumnName
(
$field
);
// check column existence
if
(
!
$
table
->
hasColumn
(
$field
)
)
{
if
(
!
$
def
)
{
throw
new
Doctrine_Query_Exception
(
'Unknown column '
.
$field
);
}
if
(
isset
(
$def
[
'owner'
]))
{
$componentAlias
=
$componentAlias
.
'.'
.
$def
[
'owner'
];
}
$tableAlias
=
$this
->
getTableAlias
(
$componentAlias
);
// build sql expression
...
...
@@ -803,9 +808,19 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
if
(
$table
->
hasColumn
(
$term
[
0
]))
{
$found
=
true
;
// get the actual field name from alias
$def
=
$table
->
getDefinitionOf
(
$term
[
0
]);
// get the actual column name from alias
$term
[
0
]
=
$table
->
getColumnName
(
$term
[
0
]);
if
(
isset
(
$def
[
'owner'
]))
{
$componentAlias
=
$componentAlias
.
'.'
.
$def
[
'owner'
];
}
$tableAlias
=
$this
->
getTableAlias
(
$componentAlias
);
$tableAlias
=
$this
->
getTableAlias
(
$componentAlias
);
if
(
$this
->
getType
()
===
Doctrine_Query
::
SELECT
)
{
...
...
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