Beispiel #1
0
 /**
  * Convert a LazyRecord schema to action.
  *
  * This is used for generating an Action View without CRUD type.
  */
 public static function convertSchemaToAction(SchemaInterface $schema, BaseModel $record = null)
 {
     $columns = $schema->getColumns(true);
     $action = new BaseRecordAction(array(), $record);
     // no actual record is null
     $action->resetParams();
     $action->initParamsFromColumns($columns, $record);
     return $action;
 }
 public function testCRUDClassFromBaseRecordAction()
 {
     $class = BaseRecordAction::createCRUDClass('App\\Model\\Post', 'Create');
     ok($class);
     is('App\\Action\\CreatePost', $class);
 }
 public function testNestedFormRendering()
 {
     $class = BaseRecordAction::createCRUDClass('ProductBundle\\Model\\Product', 'Create');
     $create = new $class();
     $view = $create->asView();
     $this->assertNotNull($view);
     $html = $view->render();
     $this->assertNotNull($html);
     $dom = new DOMDocument();
     $dom->load($html);
     ok($dom);
 }
Beispiel #4
0
 public function getRecordActionClass($type)
 {
     $class = get_class($this);
     $actionClass = \ActionKit\RecordAction\BaseRecordAction::createCRUDClass($class, $type);
     return $actionClass;
 }