예제 #1
0
 /**
  * @param string $viewName
  * @return \Dive\Table
  * @throws SchemaException
  */
 private function createView($viewName)
 {
     $viewClass = $this->schema->getViewClass($viewName, true);
     $recordClass = $this->schema->getRecordClass($viewName);
     $fields = $this->schema->getViewFields($viewName);
     $relationsData = $this->schema->getTableRelations($viewName);
     $relations = $this->instantiateRelations($relationsData);
     return new $viewClass($this, $viewName, $recordClass, $fields, $relations);
 }
예제 #2
0
파일: SchemaTest.php 프로젝트: sigma-z/dive
 public function testAddViewField()
 {
     $this->schema->addViewField('author_user_view', 'description', array('type' => 'string', 'length' => '2000'));
     $fields = $this->schema->getViewFields('author_user_view');
     $this->assertArrayHasKey('description', $fields);
 }