function ActionFormBase::getPlugin

Same name and namespace in other branches
  1. 8.9.x core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\ActionFormBase::getPlugin()
  2. 10 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
Gets the actual form array to be built.
ActionFormBase::submitForm in core/modules/action/src/Form/ActionFormBase.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form stateā€¦
ActionFormBase::validateForm in core/modules/action/src/Form/ActionFormBase.php
Form validation handler.

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.