class base implements extension_interface

A base class for extensions without custom enable/disable/purge code.

Properties

protected ContainerInterface $container
protected finder $extension_finder
protected migrator $migrator
protected string $extension_name
protected string $extension_path

Methods

__construct(ContainerInterface $container, finder $extension_finder, migrator $migrator, string $extension_name, string $extension_path)

Constructor

bool|array
is_enableable()

Indicate whether or not the extension can be enabled.

mixed
enable_step(mixed $old_state)

Single enable step that installs any included migrations

mixed
disable_step(mixed $old_state)

Single disable step that does nothing

mixed
purge_step(mixed $old_state)

Single purge step that reverts any included and installed migrations

array
get_migration_file_list()

Get the list of migration files from this extension

Details

at line 50
__construct(ContainerInterface $container, finder $extension_finder, migrator $migrator, string $extension_name, string $extension_path)

Constructor

Parameters

ContainerInterface $container

Container object

finder $extension_finder
migrator $migrator
string $extension_name

Name of this extension (from ext.manager)

string $extension_path

Relative path to this extension

at line 63
bool|array is_enableable()

Indicate whether or not the extension can be enabled.

Return Value

bool|array

True if extension is enableable, array of reasons if not, false for generic reason.

at line 74
mixed enable_step(mixed $old_state)

Single enable step that installs any included migrations

Parameters

mixed $old_state

The return value of the previous call of this method, or false on the first call

Return Value

mixed

Returns false after last step, otherwise temporary state which is passed as an argument to the next step

at line 89
mixed disable_step(mixed $old_state)

Single disable step that does nothing

Parameters

mixed $old_state

The return value of the previous call of this method, or false on the first call

Return Value

mixed

Returns false after last step, otherwise temporary state which is passed as an argument to the next step

at line 100
mixed purge_step(mixed $old_state)

Single purge step that reverts any included and installed migrations

Parameters

mixed $old_state

The return value of the previous call of this method, or false on the first call

Return Value

mixed

Returns false after last step, otherwise temporary state which is passed as an argument to the next step

at line 122
protected array get_migration_file_list()

Get the list of migration files from this extension

Return Value

array