Commit ac34484c authored by zYne's avatar zYne

--no commit message

--no commit message
parent d3a7b438
...@@ -58,14 +58,7 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access ...@@ -58,14 +58,7 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
* constant for CREATE queries * constant for CREATE queries
*/ */
const CREATE = 4; 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 * @var array $params query input parameters
*/ */
...@@ -79,24 +72,26 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access ...@@ -79,24 +72,26 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
*/ */
protected $view; protected $view;
/** /**
* @var boolean $inheritanceApplied * @var array $_aliasMap two dimensional array containing the map for query aliases
*/ * Main keys are component aliases
protected $inheritanceApplied = false; *
/** * table table object associated with given alias
* @var array $compAliases *
*
*/ */
protected $compAliases = array(); protected $_aliasMap = array();
/** /**
* @var array $tableAliases * @var array $tableAliases
*/ */
protected $tableAliases = array(); protected $tableAliases = array();
/** /**
* @var array $tableIndexes *
*/ */
protected $tableIndexes = array();
protected $pendingAggregates = array(); protected $pendingAggregates = array();
/**
*
*/
protected $subqueryAggregates = array(); protected $subqueryAggregates = array();
/** /**
* @var array $aggregateMap an array containing all aggregate aliases, keys as dql aliases * @var array $aggregateMap an array containing all aggregate aliases, keys as dql aliases
...@@ -141,15 +136,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access ...@@ -141,15 +136,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
$this->conn = $connection; $this->conn = $connection;
$this->aliasHandler = new Doctrine_Hydrate_Alias(); $this->aliasHandler = new Doctrine_Hydrate_Alias();
} }
/**
* getComponentAliases
*
* @return array
*/
public function getComponentAliases()
{
return $this->compAliases;
}
/** /**
* getTableAliases * getTableAliases
* *
...@@ -159,24 +145,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access ...@@ -159,24 +145,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
{ {
return $this->tableAliases; return $this->tableAliases;
} }
/**
* getTableIndexes
*
* @return array
*/
public function getTableIndexes()
{
return $this->tableIndexes;
}
/**
* getTables
*
* @return array
*/
public function getTables()
{
return $this->tables;
}
/** /**
* copyAliases * copyAliases
* *
...@@ -191,15 +159,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access ...@@ -191,15 +159,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
return $this; return $this;
} }
public function getPathAlias($path)
{
$s = array_search($path, $this->compAliases);
if ($s === false)
return $path;
return $s;
}
/** /**
* createSubquery * createSubquery
* *
...@@ -316,22 +275,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access ...@@ -316,22 +275,6 @@ abstract class Doctrine_Hydrate2 extends Doctrine_Access
{ {
return $this->params; 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 * setParams
* *
......
...@@ -19,6 +19,12 @@ ...@@ -19,6 +19,12 @@
* <http://www.phpdoctrine.com>. * <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 * Doctrine_NewCore_TestCase
* *
...@@ -30,10 +36,13 @@ ...@@ -30,10 +36,13 @@
* @since 1.0 * @since 1.0
* @version $Revision$ * @version $Revision$
*/ */
class Doctrine_NewCore_TestCase extends Doctrine_UnitTestCase class Doctrine_NewCore_TestCase extends Doctrine_UnitTestCase
{ {
public function testHydrate() public function testHydrate()
{ {
$q = new Doctrine_Query2();
} $q->from('User u LEFT JOIN u.Phonenumber p')->execute();
}
} }
...@@ -128,9 +128,15 @@ class Doctrine_Query_AggregateValue_TestCase extends Doctrine_UnitTestCase ...@@ -128,9 +128,15 @@ class Doctrine_Query_AggregateValue_TestCase extends Doctrine_UnitTestCase
$this->assertEqual($users->count(), 1); $this->assertEqual($users->count(), 1);
} }
public function testAggregateValueMappingSupportsLeftJoins3() public function testAggregateValueMappingSupportsMultipleValues()
{ {
$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() public function testAggregateValueMappingSupportsInnerJoins()
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment