function ActionFormBase::getPlugin

Same name and namespace in other branches
  1. 9 core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\ActionFormBase::getPlugin()
  2. 8.9.x core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\ActionFormBase::getPlugin()
  3. 11.x core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\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.

3 calls to ActionFormBase::getPlugin()
ActionFormBase::form in core/modules/action/src/Form/ActionFormBase.php
ActionFormBase::submitForm in core/modules/action/src/Form/ActionFormBase.php
ActionFormBase::validateForm in core/modules/action/src/Form/ActionFormBase.php

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.