function FormWizardBase::getFormId

Same name and namespace in other branches
  1. 8.x-3.x src/Wizard/FormWizardBase.php \Drupal\ctools\Wizard\FormWizardBase::getFormId()

Returns a unique string identifying the form.

The returned ID should be a unique string that can be a valid PHP function name, since it's used in hook implementation names such as hook_form_FORM_ID_alter().

Return value

string The unique string identifying the form.

Overrides FormInterface::getFormId

File

src/Wizard/FormWizardBase.php, line 240

Class

FormWizardBase
The base class for all form wizard.

Namespace

Drupal\ctools\Wizard

Code

public function getFormId() {
  if (!$this->getMachineName() || !$this->getTempstore()
    ->get($this->getMachineName())) {
    $cached_values = $this->initValues();
  }
  else {
    $cached_values = $this->getTempstore()
      ->get($this->getMachineName());
  }
  $operation = $this->getOperation($cached_values);
  /** @var \Drupal\Core\Form\FormInterface $operation */
  $operation = $this->classResolver
    ->getInstanceFromDefinition($operation['form']);
  return $operation->getFormId();
}