Zed. The source code to build a world.

ListSmartLineCommand extends SmartLineCommand
in package

The list command

Prints a list of bodies, locations or places.

This can easily be extended to output any list from any table.

Table of Contents

Properties

$SmartLine  : SmartLine
The SmartLine where this instance of the command is registered

Methods

__construct()  : mixed
Initializes a new instance of the SmartLine Command
get_list()  : mixed
Gets a custom list from the specified table and fields.
help()  : string|bool
Gets the command help text or indicates help should be fetched from $lang array
run()  : mixed
Runs the command
parseBoolean()  : bool

Properties

$SmartLine

The SmartLine where this instance of the command is registered

public SmartLine $SmartLine

Methods

__construct()

Initializes a new instance of the SmartLine Command

public __construct(SmartLine $SmartLine) : mixed
Parameters
$SmartLine : SmartLine

the SmartLine the command belongs

get_list()

Gets a custom list from the specified table and fields.

public get_list( $table,  $key,  $value[,  $where = null ]) : mixed

The list will be sorted by the specified key, using ascending order.

Parameters
$table :

the table to query from the database

$key :

the first field to fetch, as key

$value :

the second field to fetch, as value

$where : = null

the WHERE clause, without the WHERE keyword (optional)

help()

Gets the command help text or indicates help should be fetched from $lang array

public help() : string|bool
Return values
string|bool

a string containing the command help or the bool value false, to enable the default behavior (ie prints $lang['help']['nameOfTheCommand'])

run()

Runs the command

public run(array<string|int, mixed> $argv, int $argc) : mixed
Parameters
$argv : array<string|int, mixed>

an array of string, each item a command argument

$argc : int

the number of arguments

parseBoolean()

protected static parseBoolean(string $arg) : bool
Parameters
$arg : string
Return values
bool

        
On this page

Search results