Commit 6ed2e63d authored by romanb's avatar romanb

added hydration mode HYDRATE_NONE

parent 1ac6d509
......@@ -360,6 +360,11 @@ final class Doctrine
*/
const HYDRATE_ARRAY = 3;
/**
* HYDRATE_NONE
*/
const HYDRATE_NONE = 4;
/**
* VALIDATION CONSTANTS
*/
......
......@@ -1024,6 +1024,9 @@ class Doctrine_Hydrate extends Doctrine_Locator_Injectable implements Serializab
*/
public function parseData2($stmt, $hydrationMode)
{
if ($hydrationMode == Doctrine::HYDRATE_NONE) {
return $stmt->fetchAll(PDO::FETCH_NUM);
}
$cache = array();
$rootMap = reset($this->_aliasMap);
......
......@@ -160,4 +160,17 @@ class Doctrine_Hydrate_FetchMode_TestCase extends Doctrine_UnitTestCase
$users = $q->execute(array($u->id), Doctrine::HYDRATE_ARRAY);
$this->assertEqual($users[0]['created'], null);
}
public function testHydrateNone()
{
$u = new User();
$u->name = "fetch_array_test";
$u->created = null;
$u->save();
$q = new Doctrine_Query();
$q->select('COUNT(u.id) num')->from('User u')->where('u.id = ?');
$res = $q->execute(array($u->id), Doctrine::HYDRATE_NONE);
$this->assertEqual(1, $res[0][0]);
}
}
......@@ -240,6 +240,7 @@ class Doctrine_Record_TestCase extends Doctrine_UnitTestCase
$this->connection->clear();
$user = $this->connection->getTable('User')->find(5);
$this->assertEqual($user->name, null);
}
......
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