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
d49c6cab
Commit
d49c6cab
authored
Jul 13, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
b9f7f07a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
9 deletions
+40
-9
Hydrate.php
lib/Doctrine/Hydrate.php
+31
-2
Query.php
lib/Doctrine/Query.php
+9
-7
No files found.
lib/Doctrine/Hydrate.php
View file @
d49c6cab
...
...
@@ -22,7 +22,7 @@
/**
* Doctrine_Hydrate is a base class for Doctrine_RawSql and Doctrine_Query.
* Its purpose is to populate object graphs.
*
*
*
* @package Doctrine
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
...
...
@@ -171,6 +171,30 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
}
$this
->
_conn
=
$connection
;
}
/**
* getRootAlias
* returns the alias of the the root component
*
* @return array
*/
public
function
getRootAlias
()
{
reset
(
$this
->
_aliasMap
);
return
key
(
$this
->
_aliasMap
);
}
/**
* getRootDeclaration
* returns the root declaration
*
* @return array
*/
public
function
getRootDeclaration
()
{
$map
=
reset
(
$this
->
_aliasMap
);
return
$map
;
}
/**
* getRoot
* returns the root component for this object
...
...
@@ -374,7 +398,11 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
if
(
!
isset
(
$this
->
_tableAliasSeeds
[
$alias
]))
{
$this
->
_tableAliasSeeds
[
$alias
]
=
1
;
}
while
(
isset
(
$this
->
_tableAliases
[
$alias
]))
{
if
(
!
isset
(
$this
->
_tableAliasSeeds
[
$alias
]))
{
$this
->
_tableAliasSeeds
[
$alias
]
=
1
;
}
$alias
=
$char
.
++
$this
->
_tableAliasSeeds
[
$alias
];
}
...
...
@@ -558,7 +586,8 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
public
function
copyAliases
(
Doctrine_Hydrate
$query
)
{
$this
->
_tableAliases
=
$query
->
_tableAliases
;
$this
->
_aliasMap
=
$query
->
_aliasMap
;
$this
->
_tableAliasSeeds
=
$query
->
_tableAliasSeeds
;
return
$this
;
}
/**
...
...
lib/Doctrine/Query.php
View file @
d49c6cab
...
...
@@ -283,7 +283,6 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
throw
new
Doctrine_Query_Exception
(
'This query object is locked. No query parts can be manipulated.'
);
}
// sanity check
if
(
$queryPart
===
''
||
$queryPart
===
null
)
{
throw
new
Doctrine_Query_Exception
(
'Empty '
.
$queryPartName
.
' part given.'
);
...
...
@@ -529,7 +528,9 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
foreach
(
$this
->
pendingSubqueries
as
$value
)
{
list
(
$dql
,
$alias
)
=
$value
;
$sql
=
$this
->
createSubquery
()
->
parseQuery
(
$dql
,
false
)
->
getQuery
();
$subquery
=
$this
->
createSubquery
();
$sql
=
$subquery
->
parseQuery
(
$dql
,
false
)
->
getQuery
();
reset
(
$this
->
_aliasMap
);
$componentAlias
=
key
(
$this
->
_aliasMap
);
...
...
@@ -727,10 +728,11 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
$parts
=
$this
->
_dqlParts
;
// reset the state
$this
->
_aliasMap
=
array
();
$this
->
pendingAggregates
=
array
();
$this
->
aggregateMap
=
array
();
if
(
!
$this
->
isSubquery
())
{
$this
->
_aliasMap
=
array
();
$this
->
pendingAggregates
=
array
();
$this
->
aggregateMap
=
array
();
}
$this
->
reset
();
// parse the DQL parts
...
...
@@ -1238,7 +1240,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
}
}
else
{
$queryPart
=
$join
.
$foreignSql
.
' ON '
.
$this
->
_conn
->
quoteIdentifier
(
$localAlias
.
'.'
.
$relation
->
getLocal
())
...
...
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