PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/framework/core/db/DbSchema.php

http://zoop.googlecode.com/
PHP | 31 lines | 27 code | 4 blank | 0 comment | 1 complexity | f12077daa08601c340b9af052e6bb6c8 MD5 | raw file
 1<?php
 2class DbSchema extends Object
 3{
 4	private $conn;
 5	private $tables;
 6	
 7	function __construct($conn)
 8	{
 9		$this->conn = $conn;
10		$this->addGetter('tables');
11	}
12	
13	public function tableExists($tableName)
14	{
15		return $this->conn->tableExists($tableName);
16	}
17	
18	public function getTables()
19	{
20		if(!$this->tables)
21		{
22			$this->tables = array();
23			foreach($this->conn->getTableNames() as $thisTableName)
24			{
25				$this->tables[$thisTableName] = new DbTable($this->conn, $thisTableName);
26			}
27		}
28		
29		return $this->tables;
30	}
31}