public function AgreementForm::exists in Agreement 3.0.x
Same name and namespace in other branches
- 8.2 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 347
Class
- AgreementForm
- Add or edit agreements.
Namespace
Drupal\agreement\EntityCode
public function exists($value) {
$agreements = $this->entityTypeManager
->getStorage('agreement')
->load($value);
return !empty($agreements);
}