BlockManagerInterface
interface BlockManagerInterface implements ContextAwarePluginManagerInterface, CategorizingPluginManagerInterface, FilteredPluginManagerInterface (View source)
Provides an interface for the discovery and instantiation of block plugins.
Methods
Gets a specific plugin definition.
Indicates if a specific plugin definition exists.
Creates a pre-configured instance of a plugin.
Gets a preconfigured instance of a plugin.
Determines plugins whose constraints are satisfied by a set of contexts.
Gets sorted plugin definitions.
Gets sorted plugin definitions grouped by category.
Gets the plugin definitions for a given type and consumer and filters them.
Details
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.
array
getDefinitionsForContexts(array $contexts = [])
Determines plugins whose constraints are satisfied by a set of contexts.
string[]
getCategories()
Gets the names of all categories.
array[]
getSortedDefinitions(array $definitions = NULL)
Gets sorted plugin definitions.
array[]
getGroupedDefinitions(array $definitions = NULL)
Gets sorted plugin definitions grouped by category.
In addition to grouping, both categories and its entries are sorted, whereas plugin definitions are sorted by label.
PluginDefinitionInterface[]|array[]
getFilteredDefinitions(string $consumer, ContextInterface[]|null $contexts = NULL, array $extra = [])
Gets the plugin definitions for a given type and consumer and filters them.
This allows modules and themes to alter plugin definitions at runtime, which is useful for tasks like hiding specific plugins from a particular user interface.