1
0
mirror of synced 2024-12-13 06:46:03 +03:00

New fetchmode constants (implementation later)

This commit is contained in:
zYne 2006-08-31 22:00:44 +00:00
parent f11fe0ca34
commit 155f5193ec
2 changed files with 64 additions and 2 deletions

View File

@ -227,12 +227,66 @@ final class Doctrine {
const FETCH_VHOLDER = 1;
/**
* FETCH RECORD
*
* Specifies that the fetch method shall return Doctrine_Record
* objects as the elements of the result set.
*
* This is the default fetchmode.
*/
const FETCH_RECORD = 2;
/**
* FETCH ARRAY
* FETCH ARRAY
*/
const FETCH_ARRAY = 3;
/**
* FETCH COLUMN
* Specifies that the fetch method shall return only a single
* requested column from the next row in the result set.
*
*/
const FETCH_COLUMN = 4;
/**
* FETCH ASSOC
*
* Specifies that the fetch method shall return each row as an
* array indexed by column name as returned in the corresponding
* result set. If the result set contains multiple columns with
* the same name, PDO::FETCH_ASSOC returns only a single value per column name.
*
*/
const FETCH_ASSOC = 5;
/**
* FETCH NAMED
*
* Specifies that the fetch method shall return each row as an array indexed
* by column name as returned in the corresponding result set. If the result set
* contains multiple columns with the same name, PDO::FETCH_NAMED returns an
* array of values per column name.
*
*/
const FETCH_NAMED = 6;
/**
* FETCH NUM
*
* Specifies that the fetch method shall return each row as an array indexed by
* column number as returned in the corresponding result set, starting at column 0.
*/
const FETCH_NUM = 7;
/**
* FETCH BOTH
*
* Specifies that the fetch method shall return each row as an array indexed by both
* column name and number as returned in the corresponding result set, starting at column 0.
*/
const FETCH_BOTH = 8;
/**
* FETCH OBJ
*
* Specifies that the fetch method shall return each row as an object with property names
* that correspond to the column names returned in the result set.
*/
const FETCH_OBJ = 9;
/**

View File

@ -44,8 +44,13 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
$this->assertEqual($e->Entity[0]->getState(), Doctrine_Record::STATE_TDIRTY);
$this->assertEqual($e->Entity[1]->getState(), Doctrine_Record::STATE_TDIRTY);
$count = count($this->dbh);
$e->save();
$this->assertEqual(($count + 13), $this->dbh->count());
$this->assertEqual($e->getState(), Doctrine_Record::STATE_CLEAN);
$this->assertTrue($e->Entity[0] instanceof Entity);
$this->assertTrue($e->Entity[1] instanceof Entity);
@ -61,9 +66,12 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
$this->assertEqual($e->Entity[0]->getState(), Doctrine_Record::STATE_CLEAN);
$this->assertEqual($e->Entity[1]->getState(), Doctrine_Record::STATE_CLEAN);
$this->assertTrue(is_numeric($e->id));
$e = $e->getTable()->find($e->id);
$this->assertTrue($e instanceof Entity);
$this->assertTrue($e->Entity[0] instanceof Entity);
$this->assertTrue($e->Entity[1] instanceof Entity);