3 namespace Drupal\bootstrap_layouts\Plugin\BootstrapLayouts;
5 use Drupal\bootstrap_layouts\BootstrapLayout;
6 use Drupal\bootstrap_layouts\BootstrapLayoutsManager;
7 use Drupal\Core\Plugin\PluginBase;
8 use Symfony\Component\DependencyInjection\ContainerAwareTrait;
9 use Symfony\Component\DependencyInjection\ContainerInterface;
11 class BootstrapLayoutsUpdateBase extends PluginBase implements BootstrapLayoutsUpdateInterface {
13 use ContainerAwareTrait;
16 * The path to the provider.
25 public function __construct(array $configuration, $plugin_id, $plugin_definition, ContainerInterface $container = NULL) {
26 parent::__construct($configuration, $plugin_id, $plugin_definition);
27 if (!isset($container)) {
28 $container = \Drupal::getContainer();
30 $this->setContainer($container);
32 // Retrieve the path to provider.
33 $this->path = drupal_get_path('module', $this->pluginDefinition['provider']) ?: drupal_get_path('theme', $this->pluginDefinition['provider']);
39 public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
40 return new static($configuration, $plugin_id, $plugin_definition, $container);
46 public function getPath() {
53 public function update(BootstrapLayoutsManager $manager, array $data = [], $display_messages = TRUE) {
59 public function processExistingLayout(BootstrapLayout $layout, array $data = [], $display_messages = TRUE) {