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