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
ac34484c
Commit
ac34484c
authored
May 10, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
d3a7b438
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
73 deletions
+31
-73
Hydrate.php
draft/new-core/Hydrate.php
+13
-70
NewCoreTestCase.php
tests/NewCoreTestCase.php
+11
-2
AggregateValueTestCase.php
tests/Query/AggregateValueTestCase.php
+7
-1
No files found.
draft/new-core/Hydrate.php
View file @
ac34484c
...
...
@@ -58,14 +58,7 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
* constant for CREATE queries
*/
const
CREATE
=
4
;
/**
* @var array $tables an array containing all the tables used in the query
*/
protected
$tables
=
array
();
/**
* @var array $joins an array containing all table joins
*/
protected
$joins
=
array
();
/**
* @var array $params query input parameters
*/
...
...
@@ -79,24 +72,26 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
*/
protected
$view
;
/**
* @var boolean $inheritanceApplied
*/
protected
$inheritanceApplied
=
false
;
/**
* @var array $compAliases
* @var array $_aliasMap two dimensional array containing the map for query aliases
* Main keys are component aliases
*
* table table object associated with given alias
*
*
*/
protected
$compAliases
=
array
();
protected
$_aliasMap
=
array
();
/**
* @var array $tableAliases
*/
protected
$tableAliases
=
array
();
/**
*
@var array $tableIndexes
*
*/
protected
$tableIndexes
=
array
();
protected
$pendingAggregates
=
array
();
/**
*
*/
protected
$subqueryAggregates
=
array
();
/**
* @var array $aggregateMap an array containing all aggregate aliases, keys as dql aliases
...
...
@@ -141,15 +136,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
$this
->
conn
=
$connection
;
$this
->
aliasHandler
=
new
Doctrine_Hydrate_Alias
();
}
/**
* getComponentAliases
*
* @return array
*/
public
function
getComponentAliases
()
{
return
$this
->
compAliases
;
}
/**
* getTableAliases
*
...
...
@@ -159,24 +145,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
{
return
$this
->
tableAliases
;
}
/**
* getTableIndexes
*
* @return array
*/
public
function
getTableIndexes
()
{
return
$this
->
tableIndexes
;
}
/**
* getTables
*
* @return array
*/
public
function
getTables
()
{
return
$this
->
tables
;
}
/**
* copyAliases
*
...
...
@@ -191,15 +159,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
return
$this
;
}
public
function
getPathAlias
(
$path
)
{
$s
=
array_search
(
$path
,
$this
->
compAliases
);
if
(
$s
===
false
)
return
$path
;
return
$s
;
}
/**
* createSubquery
*
...
...
@@ -316,22 +275,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
{
return
$this
->
params
;
}
/**
* getTableAlias
*
* @param string $path
* @return string
*/
final
public
function
getTableAlias
(
$path
)
{
if
(
isset
(
$this
->
compAliases
[
$path
]))
{
$path
=
$this
->
compAliases
[
$path
];
}
if
(
!
isset
(
$this
->
tableAliases
[
$path
]))
{
return
false
;
}
return
$this
->
tableAliases
[
$path
];
}
/**
* setParams
*
...
...
tests/NewCoreTestCase.php
View file @
ac34484c
...
...
@@ -19,6 +19,12 @@
* <http://www.phpdoctrine.com>.
*/
require_once
(
'../draft/new-core/Record.php'
);
require_once
(
'../draft/new-core/Hydrate.php'
);
require_once
(
'../draft/new-core/Query.php'
);
require_once
(
'../draft/new-core/Collection.php'
);
/**
* Doctrine_NewCore_TestCase
*
...
...
@@ -30,10 +36,13 @@
* @since 1.0
* @version $Revision$
*/
class
Doctrine_NewCore_TestCase
extends
Doctrine_UnitTestCase
{
public
function
testHydrate
()
{
}
$q
=
new
Doctrine_Query2
();
$q
->
from
(
'User u LEFT JOIN u.Phonenumber p'
)
->
execute
();
}
}
tests/Query/AggregateValueTestCase.php
View file @
ac34484c
...
...
@@ -128,9 +128,15 @@ class Doctrine_Query_AggregateValue_TestCase extends Doctrine_UnitTestCase
$this
->
assertEqual
(
$users
->
count
(),
1
);
}
public
function
testAggregateValueMappingSupports
LeftJoins3
()
public
function
testAggregateValueMappingSupports
MultipleValues
()
{
$q
=
new
Doctrine_Query
();
$q
->
select
(
'u.name, COUNT(p.id) count, MAX(p.id) max'
)
->
from
(
'User u'
)
->
innerJoin
(
'u.Phonenumber p'
)
->
groupby
(
'u.id'
);
$users
=
$q
->
execute
();
$this
->
assertEqual
(
$users
[
0
]
->
Phonenumber
[
0
]
->
max
,
3
);
$this
->
assertEqual
(
$users
[
0
]
->
Phonenumber
[
0
]
->
count
,
3
);
}
public
function
testAggregateValueMappingSupportsInnerJoins
()
{
...
...
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