EntityForm::getFormId

public EntityForm::getFormId()

Returns a unique string identifying the form.

Return value

string The unique string identifying the form.

Overrides FormInterface::getFormId

File

core/lib/Drupal/Core/Entity/EntityForm.php, line 87

Class

EntityForm
Base class for entity forms.

Namespace

Drupal\Core\Entity

Code

public function getFormId() {
  $form_id = $this->entity->getEntityTypeId();
  if ($this->entity->getEntityType()->hasKey('bundle')) {
    $form_id .= '_' . $this->entity->bundle();
  }
  if ($this->operation != 'default') {
    $form_id = $form_id . '_' . $this->operation;
  }
  return $form_id . '_form';
}
doc_Drupal
2016-10-29 09:06:08
Comments
Leave a Comment

Please login to continue.