abstract class BaseApp implements Transactions

The base class from which apps must inherit

Properties

protected $API

Reference to the main API, for convenience

static private $metadata

Methods

__construct(Main $API)

All apps are constructed when Andromeda runs

mixed
Run(Input $input)

The main entry point into the app

static array
getUsage()

Returns an array of strings showing the CLI usage of the app

static string
getName()

No description

static string|null
getLogClass()

Return this app's BaseAppLog class name, if used (or null)

static 
getMetadata(string $app, string $key)

Loads a metadata for the given app with the given key

static array
getAppRequires(string $app)

No description

static string
getAppApiVersion(string $app)

No description

static string
getVersion()

No description

commit()

Tells the app to commit any changes made outside the database

rollback()

Tells the app to rollback any changes made outside the database

Details

at line 28
__construct(Main $API)

All apps are constructed when Andromeda runs

Parameters

Main $API

at line 38
abstract mixed Run(Input $input)

The main entry point into the app

Parameters

Input $input

the user input

Return Value

mixed

the value to be output to the user

at line 44
abstract static array getUsage()

Returns an array of strings showing the CLI usage of the app

Return Value

array

possible commands

at line 47
abstract static string getName()

No description

Return Value

string

the lowercase name of the app

at line 50
static protected string|null getLogClass()

Return this app's BaseAppLog class name, if used (or null)

Return Value

string|null

at line 59
static protected getMetadata(string $app, string $key)

Loads a metadata for the given app with the given key

Loads the app's JSON metadata file but not its code

Parameters

string $app
string $key

at line 77
static array getAppRequires(string $app)

No description

Parameters

string $app

Return Value

array

Returns the list of apps this app depends on

at line 83
static string getAppApiVersion(string $app)

No description

Parameters

string $app

Return Value

string

Returns the major.minor API version this app is compatible with

at line 89
static string getVersion()

No description

Return Value

string

the app's version information

at line 95
commit()

Tells the app to commit any changes made outside the database

at line 98
rollback()

Tells the app to rollback any changes made outside the database