function ActionFormBase::exists

Same name in other branches
  1. 9 core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\ActionFormBase::exists()
  2. 8.9.x core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\ActionFormBase::exists()
  3. 10 core/modules/action/src/Form/ActionFormBase.php \Drupal\action\Form\ActionFormBase::exists()

Determines if the action already exists.

Parameters

string $id: The action ID.

Return value

bool TRUE if the action exists, FALSE otherwise.

File

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

Class

ActionFormBase
Provides a base form for action forms.

Namespace

Drupal\action\Form

Code

public function exists($id) {
    $action = $this->storage
        ->load($id);
    return !empty($action);
}

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