Avolutions\Command\CreateMigrationCommand
extends AbstractCommandCreates a new Migration.
Properties
Property | Visibility | Type | Description |
---|---|---|---|
$Application | protected | \Avolutions\Core\Application | Application instance. |
$CommandDefinition | public | \Avolutions\Command\CommandDefinition | Contains Argument and Option definitions. |
$Console | protected | \Avolutions\Console\Console | Console instance for output. |
$description | protected | string | Description/help text for the Command. |
$name | protected | string | The name of the Command. |
Methods
Method | Visibility | Description |
---|---|---|
__construct() | public | Creates a new AbstractCommand instance. |
addArgumentDefinition() | public | Adds an ArgumentDefinition to the CommandDefinition. |
addOptionDefinition() | public | Adds an Option definition to the Command definition. |
execute() | public | Contains and executes the command logic. |
getArgument() | protected | Returns the value of an Argument or null if it not exists. |
getDescription() | public | Returns the description of the Command. |
getName() | public | Returns the name of the Command. |
getOption() | protected | Returns the value of an Option or null if it not exists. |
initialize() | public | Is called before the execution to initialize the Argument and Option definition of the Command. |
start() | public | Parse Argument and Option inputs and executes the Command. |
Property Details
$CommandDefinition
Contains Argument and Option definitions.
public CommandDefinition $CommandDefinition
$description
Description/help text for the Command.
protected static string $description = 'Creates a new Migration.'
Method Details
__construct()
Creates a new AbstractCommand instance.
public
__construct(Application $Application[, Console|null $Console = null ]) : mixed
Parameters
Application
$Application
Application instance.
Console|null
$Console
(optional)
Console instance for output.
addArgumentDefinition()
Adds an ArgumentDefinition to the CommandDefinition.
public
addArgumentDefinition(Argument $Argument) : void
Parameters
Argument
$Argument
The Argument definition.
Return values
void Adds an ArgumentDefinition to the CommandDefinition.addOptionDefinition()
Adds an Option definition to the Command definition.
public
addOptionDefinition(Option $Option) : void
Parameters
Option
$Option
The Option definition.
Return values
void Adds an Option definition to the Command definition.execute()
Contains and executes the command logic.
public
execute() : int
Return values
int Contains and executes the command logic.getDescription()
Returns the description of the Command.
public
static getDescription() : string
Return values
string Returns the description of the Command.getName()
Returns the name of the Command.
public
static getName() : string
Return values
string Returns the name of the Command.initialize()
Is called before the execution to initialize the Argument and Option definition of the Command.
public
initialize() : void
Return values
void Is called before the execution to initialize the Argument and Option definition of the Command.start()
Parse Argument and Option inputs and executes the Command.
public
start(array<string|int, mixed> $argv) : int
Parameters
array<string|int, mixed>
$argv
An array containing Argument and Option input.