function ActionFormBase::getPlugin

Gets the action plugin while ensuring it implements configuration form.

Return value

\Drupal\Core\Action\ActionInterface|\Drupal\Core\Plugin\PluginFormInterface|null The action plugin, or NULL if it does not implement configuration forms.

File

core/modules/action/src/Form/ActionFormBase.php, line 146

Class

ActionFormBase
Provides a base form for action forms.

Namespace

Drupal\action\Form

Code

protected function getPlugin() {
  if ($this->entity
    ->getPlugin() instanceof PluginFormInterface) {
    return $this->entity
      ->getPlugin();
  }
  return NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.