PHP Class Xethron\MigrationsGenerator\MigrateGenerateCommand

Inheritance: extends Way\Generators\Commands\GeneratorCommand
Mostra file Open project: xethron/migrations-generator

Protected Properties

Property Type Description
$batch integer
$compiler Way\Generators\Compilers\TemplateCompiler
$config Illuminate\Config\Repository
$connection string | null
$datePrefix string Filename date prefix (Y_m_d_His)
$description string The console command description.
$fields array Array of Fields to create in a new Migration Namely: Columns, Indexes and Foreign Keys
$file Way\Generators\Filesystem\Filesystem
$log boolean
$method string
$migrationName string
$migrations array List of Migrations that has been done
$name string The console command name.
$repository Illuminate\Database\Migrations\MigrationRepositoryInterface
$schemaGenerator Xethron\MigrationsGenerator\Generators\SchemaGenerator
$table string

Public Methods

Method Description
__construct ( Way\Generators\Generator $generator, Way\Generators\Filesystem\Filesystem $file, Way\Generators\Compilers\TemplateCompiler $compiler, Illuminate\Database\Migrations\MigrationRepositoryInterface $repository, Illuminate\Config\Repository $config )
fire ( ) : void Execute the console command.

Protected Methods

Method Description
askNumeric ( string $question, integer | float $default = null ) : integer | float Ask user for a Numeric Value, or blank for default
askYn ( string $question ) : boolean Ask for user input: Yes/No
generate ( string $method, array $tables ) : void Generate Migrations
getArguments ( ) : array Get the console command arguments.
getDatePrefix ( ) : string Get the date prefix for the migration.
getExcludedTables ( ) : array Get a list of tables to exclude
getFileGenerationPath ( ) : string The path where the file will be created
getOptions ( ) : array Get the console command options.
getTemplateData ( ) : array Fetch the template data
getTemplatePath ( ) : string Get path to template for generator
removeExcludedTables ( $tables ) : array Remove all the tables to exclude from the array of tables

Method Details

__construct() public method

public __construct ( Way\Generators\Generator $generator, Way\Generators\Filesystem\Filesystem $file, Way\Generators\Compilers\TemplateCompiler $compiler, Illuminate\Database\Migrations\MigrationRepositoryInterface $repository, Illuminate\Config\Repository $config )
$generator Way\Generators\Generator
$file Way\Generators\Filesystem\Filesystem
$compiler Way\Generators\Compilers\TemplateCompiler
$repository Illuminate\Database\Migrations\MigrationRepositoryInterface
$config Illuminate\Config\Repository

askNumeric() protected method

Ask user for a Numeric Value, or blank for default
protected askNumeric ( string $question, integer | float $default = null ) : integer | float
$question string Question to ask
$default integer | float Default Value (optional)
return integer | float Answer

askYn() protected method

Ask for user input: Yes/No
protected askYn ( string $question ) : boolean
$question string Question to ask
return boolean Answer from user

fire() public method

Execute the console command.
public fire ( ) : void
return void

generate() protected method

Generate Migrations
protected generate ( string $method, array $tables ) : void
$method string Create Tables or Foreign Keys ['create', 'foreign_keys']
$tables array List of tables to create migrations for
return void

getArguments() protected method

Get the console command arguments.
protected getArguments ( ) : array
return array

getDatePrefix() protected method

Get the date prefix for the migration.
protected getDatePrefix ( ) : string
return string

getExcludedTables() protected method

Get a list of tables to exclude
protected getExcludedTables ( ) : array
return array

getFileGenerationPath() protected method

The path where the file will be created
protected getFileGenerationPath ( ) : string
return string

getOptions() protected method

Get the console command options.
protected getOptions ( ) : array
return array

getTemplateData() protected method

Fetch the template data
protected getTemplateData ( ) : array
return array

getTemplatePath() protected method

Get path to template for generator
protected getTemplatePath ( ) : string
return string

removeExcludedTables() protected method

Remove all the tables to exclude from the array of tables
protected removeExcludedTables ( $tables ) : array
$tables
return array

Property Details

$batch protected_oe property

protected int $batch
return integer

$compiler protected_oe property

protected TemplateCompiler,Way\Generators\Compilers $compiler
return Way\Generators\Compilers\TemplateCompiler

$config protected_oe property

protected Repository,Illuminate\Config $config
return Illuminate\Config\Repository

$connection protected_oe property

protected string|null $connection
return string | null

$datePrefix protected_oe property

Filename date prefix (Y_m_d_His)
protected string $datePrefix
return string

$description protected_oe property

The console command description.
protected string $description
return string

$fields protected_oe property

Array of Fields to create in a new Migration Namely: Columns, Indexes and Foreign Keys
protected array $fields
return array

$file protected_oe property

protected Filesystem,Way\Generators\Filesystem $file
return Way\Generators\Filesystem\Filesystem

$log protected_oe property

protected bool $log
return boolean

$method protected_oe property

protected string $method
return string

$migrationName protected_oe property

protected string $migrationName
return string

$migrations protected_oe property

List of Migrations that has been done
protected array $migrations
return array

$name protected_oe property

The console command name.
protected string $name
return string

$repository protected_oe property

protected MigrationRepositoryInterface,Illuminate\Database\Migrations $repository
return Illuminate\Database\Migrations\MigrationRepositoryInterface

$schemaGenerator protected_oe property

protected SchemaGenerator,Xethron\MigrationsGenerator\Generators $schemaGenerator
return Xethron\MigrationsGenerator\Generators\SchemaGenerator

$table protected_oe property

protected string $table
return string