You are here

public function WorkflowTypeForm::exists in Workflow 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.

File

src/Form/WorkflowTypeForm.php, line 284

Class

WorkflowTypeForm
Provides the base form for workflow add and edit forms.

Namespace

Drupal\workflow\Form

Code

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