示例#1
0
 /**
  * initializes table instance
  *
  * @param  string $tableName
  * @throws SchemaException
  */
 private function initTable($tableName)
 {
     if (!isset($this->tables[$tableName])) {
         if ($this->schema->hasTable($tableName)) {
             $this->tables[$tableName] = $this->createTable($tableName);
             return;
         }
         if ($this->schema->hasView($tableName)) {
             $this->tables[$tableName] = $this->createView($tableName);
             return;
         }
         throw new SchemaException("Table/View '{$tableName}' not found!");
     }
 }
示例#2
0
 public function testHasTable()
 {
     $this->assertFalse($this->schema->hasTable('unknown'));
 }