/** * {@inheritdoc} */ public function setConfiguration(array $configuration) { // If the plugin id has been set already, keep it if not specified. if (isset($this->configuration['action_id'])) { $configuration += ['action_id' => $this->configuration['action_id']]; } return parent::setConfiguration($configuration); }
/** * {@inheritdoc} */ public function getConfiguration() { $configuration = parent::getConfiguration(); // We need to update the configuration in case conditions have been added or // changed. $configuration['conditions'] = []; foreach ($this->conditions as $uuid => $condition) { $configuration['conditions'][$uuid] = $condition->getConfiguration(); } return $configuration; }
/** * {@inheritdoc} */ public function getConfiguration() { $configuration = parent::getConfiguration(); // We need to update the configuration in case actions/conditions have been // added or changed. $configuration['conditions'] = $this->conditions->getConfiguration(); $configuration['actions'] = $this->actions->getConfiguration(); return $configuration; }
/** * {@inheritdoc} */ public function getLabel() { if (!empty($this->configuration['action_id'])) { $definition = $this->actionManager->getDefinition($this->configuration['action_id']); return $this->t('Action: @label', ['@label' => $definition['label']]); } return parent::getLabel(); }