interface MigrationPluginManagerInterface implements PluginManagerInterface (View source)

Migration plugin manager interface.

Methods

mixed
getDefinition(string $plugin_id, bool $exception_on_invalid = TRUE)

Gets a specific plugin definition.

array
getDefinitions()

Gets the definition of all plugins for this type.

bool
hasDefinition(string $plugin_id)

Indicates if a specific plugin definition exists.

object
createInstance(string $plugin_id, array $configuration = [])

Creates a pre-configured instance of a plugin.

object|false
getInstance(array $options)

Gets a preconfigured instance of a plugin.

createInstances(array $id, array $configuration = [])

Create pre-configured instance of plugin derivatives.

createStubMigration(array $definition)

Creates a stub migration plugin from a definition array.

createInstancesByTag(string $tag)

Create migrations given a tag.

Details

mixed getDefinition(string $plugin_id, bool $exception_on_invalid = TRUE)

Gets a specific plugin definition.

Parameters

string $plugin_id

A plugin id.

bool $exception_on_invalid

(optional) If TRUE, an invalid plugin ID will throw an exception.

Return Value

mixed

A plugin definition, or NULL if the plugin ID is invalid and $exception_on_invalid is FALSE.

Exceptions

PluginNotFoundException

array getDefinitions()

Gets the definition of all plugins for this type.

Return Value

array

An array of plugin definitions (empty array if no definitions were found). Keys are plugin IDs.

See also

FilteredPluginManagerInterface::getFilteredDefinitions

bool hasDefinition(string $plugin_id)

Indicates if a specific plugin definition exists.

Parameters

string $plugin_id

A plugin ID.

Return Value

bool

TRUE if the definition exists, FALSE otherwise.

object createInstance(string $plugin_id, array $configuration = [])

Creates a pre-configured instance of a plugin.

Parameters

string $plugin_id

The ID of the plugin being instantiated.

array $configuration

An array of configuration relevant to the plugin instance.

Return Value

object

A fully configured plugin instance.

Exceptions

PluginException

object|false getInstance(array $options)

Gets a preconfigured instance of a plugin.

Parameters

array $options

An array of options that can be used to determine a suitable plugin to instantiate and how to configure it.

Return Value

object|false

A fully configured plugin instance. The interface of the plugin instance will depend on the plugin type. If no instance can be retrieved, FALSE will be returned.

MigrationInterface[] createInstances(array $id, array $configuration = [])

Create pre-configured instance of plugin derivatives.

Parameters

array $id

Either the plugin ID or the base plugin ID of the plugins being instantiated. Also accepts an array of plugin IDs and an empty array to load all plugins.

array $configuration

An array of configuration relevant to the plugin instances. Keyed by the plugin ID.

Return Value

MigrationInterface[]

Fully configured plugin instances.

Exceptions

PluginException

Migration createStubMigration(array $definition)

Creates a stub migration plugin from a definition array.

Parameters

array $definition

The migration definition. If an 'id' key is set then this will be used as the migration ID, if not a random ID will be assigned.

Return Value

Migration

The stub migration.

array|MigrationInterface[] createInstancesByTag(string $tag)

Create migrations given a tag.

Parameters

string $tag

A migration tag we want to filter by.

Return Value

array|MigrationInterface[]

An array of migration objects with the given tag, or an empty array if no migrations with that tag exist.