diff --git a/lib/Doctrine/DataDict/Sqlite.php b/lib/Doctrine/DataDict/Sqlite.php index 125700858..dfb7ba385 100644 --- a/lib/Doctrine/DataDict/Sqlite.php +++ b/lib/Doctrine/DataDict/Sqlite.php @@ -115,8 +115,16 @@ class Doctrine_DataDict_Sqlite extends Doctrine_DataDict { $sql = "SELECT name FROM sqlite_master WHERE type='table' " . "UNION ALL SELECT name FROM sqlite_temp_master " . "WHERE type='table' ORDER BY name"; + + $tables = array(); + $stmt = $this->dbh->query($sql); - return $this->dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC); + $data = $stmt->fetchAll(PDO::FETCH_COLUMN); + + foreach($data as $table) { + $tables[] = new Doctrine_Schema_Table(array('name' => $table)); + } + return $tables; } /** * lists table triggers diff --git a/lib/Doctrine/Schema/Object.php b/lib/Doctrine/Schema/Object.php index ade4a1b8a..323152b7c 100644 --- a/lib/Doctrine/Schema/Object.php +++ b/lib/Doctrine/Schema/Object.php @@ -37,8 +37,18 @@ abstract class Doctrine_Schema_Object implements IteratorAggregate, Countable { protected $children = array(); - protected $definition = array(); + protected $definition = array('name' => ''); + public function __construct(array $definition) { + foreach($this->definition as $key => $val) { + if(isset($definition[$key])) + $this->definition[$key] = $definition[$key]; + } + } + + public function getName() { + return $this->definition['name']; + } /** * * @return int