bakeEntity() публичный Метод

Bake an entity class.
public bakeEntity ( Table $model, array $data = [] ) : string | null
$model Cake\ORM\Table Model name or object
$data array An array to use to generate the Table
Результат string | null
Пример #1
0
 /**
  * test bake() with a -plugin param
  *
  * @return void
  */
 public function testBakeEntityWithPlugin()
 {
     $this->Task->plugin = 'ModelTest';
     // fake plugin path
     Plugin::load('ModelTest', ['path' => APP . 'Plugin' . DS . 'ModelTest' . DS]);
     $path = APP . 'Plugin' . DS . 'ModelTest' . DS . 'src' . DS . 'Model' . DS . 'Entity' . DS . 'BakeArticle.php';
     $path = $this->_normalizePath($path);
     $this->Task->expects($this->once())->method('createFile')->with($path);
     $model = TableRegistry::get('BakeArticles');
     $result = $this->Task->bakeEntity($model);
     $this->assertSameAsFile(__FUNCTION__ . '.php', $result);
 }