3 namespace Drupal\bootstrap_layouts;
5 use Drupal\Core\Cache\CacheBackendInterface;
6 use Drupal\Core\Extension\ModuleHandlerInterface;
7 use Drupal\Core\Extension\ThemeHandlerInterface;
8 use Drupal\Core\Theme\ThemeManagerInterface;
10 class BootstrapLayoutsUpdateManager extends BootstrapLayoutsPluginManager {
13 * Constructs a new \Drupal\bootstrap_layouts\BootstrapLayoutsManager object.
15 * @param \Traversable $namespaces
16 * An object that implements \Traversable which contains the root paths
17 * keyed by the corresponding namespace to look for plugin implementations.
18 * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
19 * Cache backend instance to use.
20 * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
21 * The module handler to invoke the alter hook with.
22 * @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
23 * The theme manager used to invoke the alter hook with.
24 * @param \Drupal\Core\Theme\ThemeManagerInterface $theme_manager
25 * The theme manager used to invoke the alter hook with.
27 public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler, ThemeManagerInterface $theme_manager) {
28 parent::__construct($namespaces, $cache_backend, $module_handler, $theme_handler, $theme_manager, 'Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\BootstrapLayoutsUpdateInterface', 'Drupal\bootstrap_layouts\Annotation\BootstrapLayoutsUpdate');
29 $this->alterInfo('bootstrap_layouts_update_info');
30 $this->setCacheBackend($cache_backend, 'bootstrap_layouts_update_info');
34 * Retrieves the update plugins for a specific schema version.
37 * The update schema version to retrieve.
39 * @return \Drupal\bootstrap_layouts\Plugin\BootstrapLayouts\BootstrapLayoutsUpdateInterface[]
40 * An array of update plugins, keyed by their plugin id.
42 public function getUpdates($schema) {
44 foreach ($this->getDefinitions() as $plugin_id => $definition) {
45 if (isset($definition['schema']) && $definition['schema'] == $schema) {
46 $updates[$plugin_id] = $this->createInstance($plugin_id);