You are here

private function ContributorRoleDeleteForm::checkInReference in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/src/Form/ContributorRoleDeleteForm.php \Drupal\bibcite_entity\Form\ContributorRoleDeleteForm::checkInReference()

Find if author of this role is in reference entity.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

1 call to ContributorRoleDeleteForm::checkInReference()
ContributorRoleDeleteForm::init in modules/bibcite_entity/src/Form/ContributorRoleDeleteForm.php
Initialize the form state and the entity before the first form build.

File

modules/bibcite_entity/src/Form/ContributorRoleDeleteForm.php, line 27

Class

ContributorRoleDeleteForm
Builds the form to delete Contributor role entities.

Namespace

Drupal\bibcite_entity\Form

Code

private function checkInReference() {
  $storage = $this->entityTypeManager
    ->getStorage('bibcite_reference');
  $query = $storage
    ->getQuery();
  return !empty($query
    ->condition('author.role', $this->entity
    ->id())
    ->range(0, 1)
    ->execute());
}