1
0
mirror of synced 2025-02-20 14:13:15 +03:00

Support for uppercase columns

This commit is contained in:
doctrine 2006-06-05 10:24:14 +00:00
parent bcf9ca78e0
commit f5f3b0d27a
4 changed files with 32 additions and 10 deletions

View File

@ -422,7 +422,7 @@ class Doctrine_Query extends Doctrine_Access {
$array = $this->parseData($stmt);
$colls = array();
$colls = array();
foreach($array as $data) {
/**
@ -509,11 +509,7 @@ class Doctrine_Query extends Doctrine_Access {
*/
public function parseData(PDOStatement $stmt) {
$array = array();
$keys = array();
foreach(array_keys($this->tables) as $key) {
$k = strtolower($key);
$keys[$k] = $key;
}
while($data = $stmt->fetch(PDO::FETCH_ASSOC)):
/**
* parse the data into two-dimensional array
@ -522,7 +518,7 @@ class Doctrine_Query extends Doctrine_Access {
$e = explode("__",$key);
if(count($e) > 1) {
$data[$keys[$e[0]]][$e[1]] = $value;
$data[$e[0]][$e[1]] = $value;
} else {
$data[0][$e[0]] = $value;
}

View File

@ -143,7 +143,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
}
// get the data array
$this->data = $this->table->getData();
// get the column count
$count = count($this->data);

View File

@ -80,9 +80,9 @@ abstract class Doctrine_Session extends Doctrine_Configurable implements Countab
$this->dbh = $pdo;
$this->state = Doctrine_Session::STATE_OPEN;
$this->setParent($manager);
$this->setParent($manager);
$this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
$this->dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL);
$this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
switch($this->getAttribute(Doctrine::ATTR_CACHE)):

View File

@ -272,6 +272,32 @@ class ORM_TestItem extends Doctrine_Record {
$this->hasOne("ORM_TestEntry", "ORM_TestEntry.itemID");
}
}
class ORM_AccessControl extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn("name", "string", 255);
}
public function setUp() {
$this->hasMany("ORM_AccessGroup as accessGroups", "ORM_AccessControlsGroups.accessGroupID");
}
}
class ORM_AccessGroup extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn("name", "string", 255);
}
public function setUp() {
$this->hasMany("ORM_AccessControl as accessControls", "ORM_AccessControlsGroups.accessControlID");
}
}
class ORM_AccessControlsGroups extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn("accessControlID", "integer", 11);
$this->hasColumn("accessGroupID", "integer", 11);
$this->setPrimaryKey(array("accessControlID", "accessGroupID"));
}
}
class Log_Entry extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn("stamp", "timestamp");