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
c9d9bf19
Commit
c9d9bf19
authored
May 19, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
bbe6f1c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
RawSql.php
lib/Doctrine/RawSql.php
+9
-9
No files found.
lib/Doctrine/RawSql.php
View file @
c9d9bf19
...
...
@@ -65,7 +65,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
public
function
get
(
$name
)
{
if
(
!
isset
(
$this
->
parts
[
$name
]))
{
throw
new
Doctrine_RawSql_Exception
(
'Unknown query part '
.
$name
);
throw
new
Doctrine_RawSql_Exception
(
'Unknown query part '
.
$name
);
}
return
$this
->
parts
[
$name
];
}
...
...
@@ -135,26 +135,26 @@ class Doctrine_RawSql extends Doctrine_Hydrate
public
function
getQuery
()
{
foreach
(
$this
->
fields
as
$field
)
{
$e
=
explode
(
"."
,
$field
);
$e
=
explode
(
'.'
,
$field
);
if
(
!
isset
(
$e
[
1
]))
{
throw
new
Doctrine_RawSql_Exception
(
"All selected fields in Sql query must be in format tableAlias.fieldName"
);
throw
new
Doctrine_RawSql_Exception
(
'All selected fields in Sql query must be in format tableAlias.fieldName'
);
}
if
(
!
isset
(
$this
->
tables
[
$e
[
0
]]))
{
try
{
$this
->
addComponent
(
$e
[
0
],
ucwords
(
$e
[
0
]));
}
catch
(
Doctrine_Exception
$exception
)
{
throw
new
Doctrine_RawSql_Exception
(
"The associated component for table alias
$e[0]
couldn't be found."
);
throw
new
Doctrine_RawSql_Exception
(
'The associated component for table alias '
.
$e
[
0
]
.
' couldn\'t be found.'
);
}
}
if
(
$e
[
1
]
==
'*'
)
{
foreach
(
$this
->
tables
[
$e
[
0
]]
->
getColumnNames
()
as
$name
)
{
$field
=
$e
[
0
]
.
"."
.
$name
;
$this
->
parts
[
"select"
][
$field
]
=
$field
.
" AS "
.
$e
[
0
]
.
"__"
.
$name
;
$field
=
$e
[
0
]
.
'.'
.
$name
;
$this
->
parts
[
'select'
][
$field
]
=
$field
.
' AS '
.
$e
[
0
]
.
'__'
.
$name
;
}
}
else
{
$field
=
$e
[
0
]
.
"."
.
$e
[
1
];
$this
->
parts
[
"select"
][
$field
]
=
$field
.
" AS "
.
$e
[
0
]
.
"__"
.
$e
[
1
];
$field
=
$e
[
0
]
.
'.'
.
$e
[
1
];
$this
->
parts
[
'select'
][
$field
]
=
$field
.
' AS '
.
$e
[
0
]
.
'__'
.
$e
[
1
];
}
}
...
...
@@ -169,7 +169,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate
}
}
$q
=
'SELECT '
.
implode
(
', '
,
$this
->
parts
[
'select'
]);
$q
=
'SELECT '
.
implode
(
', '
,
$this
->
parts
[
'select'
]);
$string
=
$this
->
applyInheritance
();
if
(
!
empty
(
$string
))
{
...
...
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