Beispiel #1
0
 /**
  * @param  string $tableName
  * @return \Dive\Table
  * @throws SchemaException
  */
 private function createTable($tableName)
 {
     $tableClass = $this->schema->getTableClass($tableName, true);
     $recordClass = $this->schema->getRecordClass($tableName);
     $fields = $this->schema->getTableFields($tableName);
     $relationsData = $this->schema->getTableRelations($tableName);
     $relations = $this->instantiateRelations($relationsData);
     $indexes = $this->schema->getTableIndexes($tableName);
     $this->initTableBehaviors($tableName);
     return new $tableClass($this, $tableName, $recordClass, $fields, $relations, $indexes);
 }
Beispiel #2
0
 public function testGetTableClassWithAutoload()
 {
     $tableClass = $this->schema->getTableClass('user', true);
     $this->assertEquals('\\Dive\\Table', $tableClass);
 }