You are here

public function AgreementForm::exists in Agreement 8.2

Same name and namespace in other branches
  1. 3.0.x src/Entity/AgreementForm.php \Drupal\agreement\Entity\AgreementForm::exists()

Checks if the machine name exists.

Parameters

string $value: The machine name to check.

Return value

bool TRUE if the machine name exists already.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/Entity/AgreementForm.php, line 333

Class

AgreementForm
Add or edit agreements.

Namespace

Drupal\agreement\Entity

Code

public function exists($value) {
  $agreements = $this->entityTypeManager
    ->getStorage('agreement')
    ->load($value);
  return !empty($agreements);
}