You are here

public function EntityLegalDocumentForm::exists in Entity Legal 8

Machine name exists callback for legal document id.

Parameters

string $id: The ID of the machine name for the new Entity.

Return value

bool Whether or not an Entity with the same machine name exists.

File

src/Form/EntityLegalDocumentForm.php, line 160
Contains \Drupal\entity_legal\Form\EntityLegalDocumentForm.

Class

EntityLegalDocumentForm
Entity Legal Document create and edit form handler.

Namespace

Drupal\entity_legal\Form

Code

public function exists($id) {
  $entity = $this->entityQuery
    ->get('entity_legal_document')
    ->condition('id', $id)
    ->execute();
  return (bool) $entity;
}