You are here

public function FormsStepsAddForm::exists in Forms Steps 8

Machine name exists callback.

Parameters

string $id: The machine name ID.

Return value

bool TRUE if an entity with the same name already exists, FALSE otherwise.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/Form/FormsStepsAddForm.php, line 74

Class

FormsStepsAddForm
Provides a form to add a Forms Steps.

Namespace

Drupal\forms_steps\Form

Code

public function exists($id) {
  $type = $this->entity
    ->getEntityTypeId();
  return (bool) $this->entityTypeManager
    ->getStorage($type)
    ->load($id);
}