/framework/core/db/DbSchema.php
http://zoop.googlecode.com/ · PHP · 31 lines · 27 code · 4 blank · 0 comment · 1 complexity · f12077daa08601c340b9af052e6bb6c8 MD5 · raw file
- <?php
- class DbSchema extends Object
- {
- private $conn;
- private $tables;
-
- function __construct($conn)
- {
- $this->conn = $conn;
- $this->addGetter('tables');
- }
-
- public function tableExists($tableName)
- {
- return $this->conn->tableExists($tableName);
- }
-
- public function getTables()
- {
- if(!$this->tables)
- {
- $this->tables = array();
- foreach($this->conn->getTableNames() as $thisTableName)
- {
- $this->tables[$thisTableName] = new DbTable($this->conn, $thisTableName);
- }
- }
-
- return $this->tables;
- }
- }