You are here

public function FormWizardBase::getFormId in Chaos Tool Suite (ctools) 8.3

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 229

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 $operation \Drupal\Core\Form\FormInterface */
  $operation = $this->classResolver
    ->getInstanceFromDefinition($operation['form']);
  return $operation
    ->getFormId();
}