public function writeTableOut($index, OutputInterface $output = null, $force = false)
    {
        if ($this->status !== self::STATUS_IN_PROGRESS && $this->status !== self::STATUS_RECURSIVE_FOREIGN_KEY) {
            return;
        }

        $class = studly_case('create_' . snake_case($this->table->getTableName()) . '_table');

        $fileName = date('Y_m_d_') . str_pad($index, 6, '0', STR_PAD_LEFT) . '_' . snake_case($class) . '.php';

        $this->writeToFileFromTemplate($this->path . '/' . $fileName, 'migrationCreateTable', $output, [
            'className'   => $class,
            'tableName'   => snake_case($this->table->getTableName()),
            'columns'     => $this->table->renderCreateColumns(),
            'indexes'     => $this->table->renderCreateIndexes(),
            'foreignKeys' => $this->status === self::STATUS_IN_PROGRESS ? $this->table->renderCreateForeignKeys() : '',
        ], $force);
    }
public function writeTableOut($index, OutputInterface $output = null, $force = false)
    {
        if ($this->status !== self::STATUS_IN_PROGRESS && $this->status !== self::STATUS_RECURSIVE_FOREIGN_KEY) {
            return;
        }

        $class = studly_case('create_' . snake_case($this->table->getTableName()) . '_table');

        $fileName = date('Y_m_d_') . str_pad($index, 6, '0', STR_PAD_LEFT) . '_' . snake_case($class) . '.php';

        $this->writeToFileFromTemplate($this->path . '/' . $fileName, 'migrationCreateTable', $output, [
            'className'   => $class,
            'tableName'   => snake_case($this->table->getTableName()),
            'columns'     => $this->table->renderCreateColumns(),
            'indexes'     => $this->table->renderCreateIndexes(),
            'foreignKeys' => $this->status === self::STATUS_IN_PROGRESS ? $this->table->renderCreateForeignKeys() : '',
        ], $force);
    }
public function writeTableOut ( $ index , OutputInterface $ output = null , $ force = false ) { if ( $ this -> status !== self :: STATUS_IN_PROGRESS && $ this -> status !== self :: STATUS_RECURSIVE_FOREIGN_KEY ) { return ; } $ class = studly_case ( 'create_' . snake_case ( $ this -> table -> getTableName ( ) ) . '_table' ) ; $ fileName = date ( 'Y_m_d_' ) . str_pad ( $ index , 6 , '0' , STR_PAD_LEFT ) . '_' . snake_case ( $ class ) . '.php' ; $ this -> writeToFileFromTemplate ( $ this -> path . '/' . $ fileName , 'migrationCreateTable' , $ output , [ 'className' => $ class , 'tableName' => snake_case ( $ this -> table -> getTableName ( ) ) , 'columns' => $ this -> table -> renderCreateColumns ( ) , 'indexes' => $ this -> table -> renderCreateIndexes ( ) , 'foreignKeys' => $ this -> status === self :: STATUS_IN_PROGRESS ? $ this -> table -> renderCreateForeignKeys ( ) : '' , ] , $ force ) ; }
Render migration create table class and write out to file

@param int                                                    $index  migration file index
@param \Symfony\Component\Console\Output\OutputInterface|null $output command line output
@param bool                                                   $force  force overwrite existing models or not
Render migration create table class and write out to file