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
3a5bd47f
Commit
3a5bd47f
authored
Jan 28, 2008
by
lsmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- ws fixes
parent
be445e73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
RawSql.php
lib/Doctrine/RawSql.php
+25
-25
No files found.
lib/Doctrine/RawSql.php
View file @
3a5bd47f
...
...
@@ -42,7 +42,7 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
* @var array $fields
*/
private
$fields
=
array
();
/**
* @deprecated
*/
...
...
@@ -66,24 +66,24 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
* the given query part stack with $queryPart
* @return Doctrine_Query this object
*/
public
function
parseDqlQueryPart
(
$queryPartName
,
$queryPart
,
$append
=
false
)
public
function
parseDqlQueryPart
(
$queryPartName
,
$queryPart
,
$append
=
false
)
{
if
(
$queryPartName
==
'select'
)
{
$this
->
_parseSelectFields
(
$queryPart
);
return
$this
;
}
if
(
!
isset
(
$this
->
parts
[
$queryPartName
]))
{
$this
->
_sqlParts
[
$queryPartName
]
=
array
();
}
if
(
!
$append
)
{
$this
->
_sqlParts
[
$queryPartName
]
=
array
(
$queryPart
);
}
else
{
$this
->
_sqlParts
[
$queryPartName
][]
=
$queryPart
;
}
return
$this
;
$this
->
_parseSelectFields
(
$queryPart
);
return
$this
;
}
if
(
!
isset
(
$this
->
parts
[
$queryPartName
]))
{
$this
->
_sqlParts
[
$queryPartName
]
=
array
();
}
if
(
!
$append
)
{
$this
->
_sqlParts
[
$queryPartName
]
=
array
(
$queryPart
);
}
else
{
$this
->
_sqlParts
[
$queryPartName
][]
=
$queryPart
;
}
return
$this
;
}
/**
* Adds a DQL query part. Overrides Doctrine_Query_Abstract::_addDqlQueryPart().
* This implementation for RawSql parses the new parts right away, generating the SQL.
...
...
@@ -92,7 +92,7 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
{
return
$this
->
parseQueryPart
(
$queryPartName
,
$queryPart
,
$append
);
}
/**
* Add select parts to fields.
*
...
...
@@ -103,8 +103,8 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
$this
->
fields
=
$m
[
1
];
$this
->
_sqlParts
[
'select'
]
=
array
();
}
public
function
parseQuery
(
$query
)
{
return
$this
->
parseDqlQuery
(
$query
);
...
...
@@ -159,8 +159,8 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
if
(
!
isset
(
$parts
[
$type
][
0
]))
{
$parts
[
$type
][
0
]
=
$part
;
}
else
{
// why does this add to index 0 and not append to the
// array. If it had done that one could have used
// why does this add to index 0 and not append to the
// array. If it had done that one could have used
// parseQueryPart.
$parts
[
$type
][
0
]
.=
' '
.
$part
;
}
...
...
@@ -180,7 +180,7 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
* @return string the built sql query
*/
public
function
getSqlQuery
(
$params
=
array
())
{
{
$select
=
array
();
foreach
(
$this
->
fields
as
$field
)
{
...
...
@@ -198,7 +198,7 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
}
$componentAlias
=
$this
->
getComponentAlias
(
$e
[
0
]);
if
(
$e
[
1
]
==
'*'
)
{
foreach
(
$this
->
_queryComponents
[
$componentAlias
][
'table'
]
->
getColumnNames
()
as
$name
)
{
$field
=
$e
[
0
]
.
'.'
.
$name
;
...
...
@@ -224,7 +224,7 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
}
}
}
// first add the fields of the root component
reset
(
$this
->
_queryComponents
);
$componentAlias
=
key
(
$this
->
_queryComponents
);
...
...
@@ -315,7 +315,7 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract
if
(
!
isset
(
$table
))
{
$conn
=
Doctrine_Manager
::
getInstance
()
->
getConnectionForComponent
(
$component
);
$table
=
$conn
->
getTable
(
$component
);
$this
->
_queryComponents
[
$componentAlias
]
=
array
(
'table'
=>
$table
,
'mapper'
=>
$conn
->
getMapper
(
$component
));
...
...
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