You are here

public function GroupRoleForm::exists in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Form/GroupRoleForm.php \Drupal\group\Entity\Form\GroupRoleForm::exists()

Checks whether a group role ID exists already.

Parameters

string $id:

Return value

bool Whether the ID is taken.

File

src/Entity/Form/GroupRoleForm.php, line 142

Class

GroupRoleForm
Form controller for group role forms.

Namespace

Drupal\group\Entity\Form

Code

public function exists($id) {

  /** @var \Drupal\group\Entity\GroupRoleInterface $group_role */
  $group_role = $this->entity;
  return (bool) GroupRole::load($group_role
    ->getGroupTypeId() . '-' . $id);
}