pluginCollection) { $this->pluginCollection = new ActionPluginCollection(\Drupal::service('plugin.manager.action'), $this->plugin, $this->configuration); } return $this->pluginCollection; } /** * {@inheritdoc} */ public function getPluginCollections() { return ['configuration' => $this->getPluginCollection()]; } /** * {@inheritdoc} */ public function getPlugin() { return $this->getPluginCollection()->get($this->plugin); } /** * {@inheritdoc} */ public function setPlugin($plugin_id) { $this->plugin = $plugin_id; $this->getPluginCollection()->addInstanceId($plugin_id); } /** * {@inheritdoc} */ public function getPluginDefinition() { return $this->getPlugin()->getPluginDefinition(); } /** * {@inheritdoc} */ public function execute(array $entities) { return $this->getPlugin()->executeMultiple($entities); } /** * {@inheritdoc} */ public function isConfigurable() { return $this->getPlugin() instanceof ConfigurablePluginInterface; } /** * {@inheritdoc} */ public function getType() { return $this->type; } /** * {@inheritdoc} */ public static function sort(ConfigEntityInterface $a, ConfigEntityInterface $b) { /** @var \Drupal\system\ActionConfigEntityInterface $a */ /** @var \Drupal\system\ActionConfigEntityInterface $b */ $a_type = $a->getType(); $b_type = $b->getType(); if ($a_type != $b_type) { return strnatcasecmp($a_type, $b_type); } return parent::sort($a, $b); } }