public function suggestName($operations = null, $id = null)
    {
        $prefix = $this->migrationNamePrefix;
        if (null === $operations) {
            return sprintf('%s0001_Initial', $prefix);
        }
        if (1 == count($operations)) {
            $op = $operations[0];
            if ($op instanceof CreateModel) {
                return sprintf(
                    '%s%s_%s',
                    $prefix,
                    $id,
                    $this->formatName($op->name, $op->getAppLabel())
                );
            } elseif ($op instanceof DeleteModel) {
                return sprintf(
                    '%s%s_Delete_%s',
                    $prefix,
                    $id,
                    $this->formatName($op->name, $op->getAppLabel())
                );
            } elseif ($op instanceof AddField) {
                return sprintf(
                    '%s%s_%s_%s',
                    $prefix,
                    $id,
                    $this->formatName($op->modelName, $op->getAppLabel()),
                    $this->formatName($op->name)
                );
            } elseif ($op instanceof RemoveField) {
                return sprintf(
                    '%s%s_Remove_%s_%s',
                    $prefix,
                    $id,
                    $this->formatName($op->modelName, $op->getAppLabel()),
                    $this->formatName($op->name)
                );
            }
        }

        return sprintf('%s%s_Auto_%s', $prefix, $id, date('Ymd_hm'));
    }
public function suggestName($operations = null, $id = null)
    {
        $prefix = $this->migrationNamePrefix;
        if (null === $operations) {
            return sprintf('%s0001_Initial', $prefix);
        }
        if (1 == count($operations)) {
            $op = $operations[0];
            if ($op instanceof CreateModel) {
                return sprintf(
                    '%s%s_%s',
                    $prefix,
                    $id,
                    $this->formatName($op->name, $op->getAppLabel())
                );
            } elseif ($op instanceof DeleteModel) {
                return sprintf(
                    '%s%s_Delete_%s',
                    $prefix,
                    $id,
                    $this->formatName($op->name, $op->getAppLabel())
                );
            } elseif ($op instanceof AddField) {
                return sprintf(
                    '%s%s_%s_%s',
                    $prefix,
                    $id,
                    $this->formatName($op->modelName, $op->getAppLabel()),
                    $this->formatName($op->name)
                );
            } elseif ($op instanceof RemoveField) {
                return sprintf(
                    '%s%s_Remove_%s_%s',
                    $prefix,
                    $id,
                    $this->formatName($op->modelName, $op->getAppLabel()),
                    $this->formatName($op->name)
                );
            }
        }

        return sprintf('%s%s_Auto_%s', $prefix, $id, date('Ymd_hm'));
    }
public function suggestName ( $ operations = null , $ id = null ) { $ prefix = $ this -> migrationNamePrefix ; if ( null === $ operations ) { return sprintf ( '%s0001_Initial' , $ prefix ) ; } if ( 1 == count ( $ operations ) ) { $ op = $ operations [ 0 ] ; if ( $ op instanceof CreateModel ) { return sprintf ( '%s%s_%s' , $ prefix , $ id , $ this -> formatName ( $ op -> name , $ op -> getAppLabel ( ) ) ) ; } elseif ( $ op instanceof DeleteModel ) { return sprintf ( '%s%s_Delete_%s' , $ prefix , $ id , $ this -> formatName ( $ op -> name , $ op -> getAppLabel ( ) ) ) ; } elseif ( $ op instanceof AddField ) { return sprintf ( '%s%s_%s_%s' , $ prefix , $ id , $ this -> formatName ( $ op -> modelName , $ op -> getAppLabel ( ) ) , $ this -> formatName ( $ op -> name ) ) ; } elseif ( $ op instanceof RemoveField ) { return sprintf ( '%s%s_Remove_%s_%s' , $ prefix , $ id , $ this -> formatName ( $ op -> modelName , $ op -> getAppLabel ( ) ) , $ this -> formatName ( $ op -> name ) ) ; } } return sprintf ( '%s%s_Auto_%s' , $ prefix , $ id , date ( 'Ymd_hm' ) ) ; }
Try to guess a name for the migration that is to be created.

@param Operation[] $operations

@return string

@since  1.1.0

@author Eddilbert Macharia (http://eddmash.com) <edd.cowan@gmail.com>
Try to guess a name for the migration that is to be created .