Arikaim CMS

ListCommand extends ConsoleCommand
in package

Templates list command

Table of Contents

Properties

$default  : bool
Set to true for default command
$dispatcher  : EventDispatcher
Event dispatcher
$input  : InputInterface
Input
$output  : OutputInterface
Output
$outputType  : string|null
Output type
$result  : array<string|int, mixed>
Command result data
$style  : SymfonyStyle
Style obj reference
$table  : Table
Table output
$progress  : ProgressBar|null
Progress bar ref

Methods

__construct()  : mixed
Constructor
addOptionalArgument()  : void
Add optional argument
addOptionalOption()  : void
Add optional option
addRequiredArgument()  : void
Add required argument
checkMark()  : void
Show CHECK MARK
getResult()  : array<string|int, mixed>
Get execution result
isConsoleOutput()  : bool
Return true if output is to console
isDefault()  : bool
Return true if command is default.
isJsonOutput()  : bool
Return true if output is to console
newLine()  : void
New line
run()  : mixed
Run method wrapper
setDefault()  : void
Set command as default
setDispatcher()  : void
Set event dispatcher
setOutputType()  : void
Set output type
showCompleted()  : void
Show 'done' message
showError()  : void
Show error message
showErrorDetails()  : void
Show error details
showErrors()  : void
Show multipel errors
showTitle()  : void
Show command title
table()  : Table
Get table obj
writeField()  : void
Write field
writeFieldLn()  : void
Write field
writeLn()  : void
Write line
choice()  : mixed
Choice question
configure()  : void
Configure command
confirmation()  : bool
Ask confirmation question
execute()  : mixed
Run console command
executeCommand()  : void
Run command
progress()  : ProgressBar
Get progress bar
question()  : mixed
Ask console question

Properties

$default

Set to true for default command

protected bool $default = false

$dispatcher

Event dispatcher

protected EventDispatcher $dispatcher

$outputType

Output type

protected string|null $outputType = null

$result

Command result data

protected array<string|int, mixed> $result = []

Methods

__construct()

Constructor

public __construct([string|null $name = null ][, string|null $description = null ]) : mixed
Parameters
$name : string|null = null
$description : string|null = null

addOptionalArgument()

Add optional argument

public addOptionalArgument(string $name[, string $description = '' ][, mixed|null $default = null ]) : void
Parameters
$name : string
$description : string = ''
$default : mixed|null = null

addOptionalOption()

Add optional option

public addOptionalOption(string $name[, string $description = '' ][, mixed|null $default = null ]) : void
Parameters
$name : string
$description : string = ''
$default : mixed|null = null

addRequiredArgument()

Add required argument

public addRequiredArgument(string $name[, string $description = '' ][, mixed|null $default = null ]) : void
Parameters
$name : string
$description : string = ''
$default : mixed|null = null

checkMark()

Show CHECK MARK

public checkMark([string $space = ' ' ]) : void
Parameters
$space : string = ' '

getResult()

Get execution result

public getResult() : array<string|int, mixed>
Return values
array<string|int, mixed>

isConsoleOutput()

Return true if output is to console

public isConsoleOutput() : bool
Return values
bool

isDefault()

Return true if command is default.

public isDefault() : bool
Return values
bool

isJsonOutput()

Return true if output is to console

public isJsonOutput() : bool
Return values
bool

run()

Run method wrapper

public run(InputInterface $input, OutputInterface $output) : mixed
Parameters
$input : InputInterface
$output : OutputInterface

setDefault()

Set command as default

public setDefault([bool $default = true ]) : void
Parameters
$default : bool = true

setDispatcher()

Set event dispatcher

public setDispatcher(object $dispatcher) : void
Parameters
$dispatcher : object

setOutputType()

Set output type

public setOutputType(string|null $outputType) : void
Parameters
$outputType : string|null

showCompleted()

Show 'done' message

public showCompleted([string|null $label = null ][, string $space = ' ' ]) : void
Parameters
$label : string|null = null
$space : string = ' '

showError()

Show error message

public showError(string $message[, string $label = 'Error:' ][, string $space = ' ' ]) : void
Parameters
$message : string
$label : string = 'Error:'
$space : string = ' '

showErrorDetails()

Show error details

public showErrorDetails(string|array<string|int, mixed> $details[, string $space = ' ' ]) : void
Parameters
$details : string|array<string|int, mixed>
$space : string = ' '

showErrors()

Show multipel errors

public showErrors(string|array<string|int, mixed> $errors[, string $label = 'Error:' ][, string $space = ' ' ]) : void
Parameters
$errors : string|array<string|int, mixed>
$label : string = 'Error:'
$space : string = ' '

showTitle()

Show command title

public showTitle([string $title = null ][, string $space = ' ' ]) : void
Parameters
$title : string = null
$space : string = ' '

table()

Get table obj

public table() : Table
Return values
Table

writeField()

Write field

public writeField(string $label, mixed $value[, string $color = 'cyan' ][, string $space = ' ' ]) : void
Parameters
$label : string
$value : mixed
$color : string = 'cyan'
$space : string = ' '

writeFieldLn()

Write field

public writeFieldLn(string $label, mixed $value[, string $color = 'cyan' ][, string $space = ' ' ]) : void
Parameters
$label : string
$value : mixed
$color : string = 'cyan'
$space : string = ' '

writeLn()

Write line

public writeLn(string $text[, string $space = ' ' ][, string $color = null ]) : void
Parameters
$text : string
$space : string = ' '
$color : string = null

choice()

Choice question

protected choice(string $text, array<string|int, mixed> $items[, bool $multiselect = false ][, string|null $error = null ]) : mixed
Parameters
$text : string
$items : array<string|int, mixed>
$multiselect : bool = false
$error : string|null = null

configure()

Configure command

protected configure() : void

confirmation()

Ask confirmation question

protected confirmation(string $text[, bool $default = true ]) : bool
Parameters
$text : string
$default : bool = true
Return values
bool

execute()

Run console command

protected execute(InputInterface $input, OutputInterface $output) : mixed
Parameters
$input : InputInterface
$output : OutputInterface

executeCommand()

Run command

protected executeCommand(InputInterface $input, OutputInterface $output) : void
Parameters
$input : InputInterface
$output : OutputInterface

progress()

Get progress bar

protected progress([int|null $max = null ]) : ProgressBar
Parameters
$max : int|null = null
Return values
ProgressBar

question()

Ask console question

protected question(string $text[, mixed $default = null ][, array<string|int, mixed> $autocomplete = [] ]) : mixed
Parameters
$text : string
$default : mixed = null
$autocomplete : array<string|int, mixed> = []

        
On this page

Search results