API Documentation (v0.9.0-alpha)

Avolutions\Command\DatabaseMigrateCommand

extends AbstractCommand

Executes all new migrations.

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
$Application

Application instance.

protected Application $Application
$Console

Console instance for output.

protected Console $Console
$description

Description/help text for the Command.

protected static string $description = 'Executes all new migrations.'
$name

The name of the Command.

protected static string $name = 'database-migrate'

Method Details

__construct()

Creates a new AbstractCommand instance.

public __construct(Application $Application, Migrator $Migrator[, Console|null $Console = null ]) : mixed
Parameters

Application $Application
Application instance.

Migrator $Migrator

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.

Return values
int Parse Argument and Option inputs and executes the Command.
getArgument()

Returns the value of an Argument or null if it not exists.

protected getArgument(string $name) : mixed
Parameters

string $name
The name of the Argument.

Return values
mixed Returns the value of an Argument or null if it not exists.
getOption()

Returns the value of an Option or null if it not exists.

protected getOption(string $name) : mixed
Parameters

string $name
The name of the Option.

Return values
mixed Returns the value of an Option or null if it not exists.