Bake\Shell\Task\ModelTask::main PHP Метод

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

Execution method always used for tasks
public main ( string | null $name = null ) : void
$name string | null The name of the table to bake.
Результат void
    public function main($name = null)
    {
        parent::main();
        $name = $this->_getName($name);
        if (empty($name)) {
            $this->out('Choose a model to bake from the following:');
            foreach ($this->listUnskipped() as $table) {
                $this->out('- ' . $this->_camelize($table));
            }
            return;
        }
        $this->bake($this->_camelize($name));
    }

Usage Example

Пример #1
0
 /**
  * test that execute passes with different inflections of the same name.
  *
  * @dataProvider nameVariations
  * @return void
  */
 public function testMainWithNamedModelVariations($name)
 {
     $this->Task->connection = 'test';
     $filename = $this->_normalizePath(APP . 'Model/Table/BakeArticlesTable.php');
     $this->Task->expects($this->at(0))->method('createFile')->with($filename, $this->stringContains('class BakeArticlesTable extends Table'));
     $this->Task->main($name);
 }
All Usage Examples Of Bake\Shell\Task\ModelTask::main