You are here

public function Registrant::hasIdentity in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/Entity/Registrant.php \Drupal\rng\Entity\Registrant::hasIdentity()
  2. 3.x src/Entity/Registrant.php \Drupal\rng\Entity\Registrant::hasIdentity()

Checks if the identity is the registrant.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The identity to check is associated with this registrant.

Return value

boolean Whether the identity is the registrant.

Overrides RegistrantInterface::hasIdentity

File

src/Entity/Registrant.php, line 101

Class

Registrant
Defines the registrant entity class.

Namespace

Drupal\rng\Entity

Code

public function hasIdentity(EntityInterface $entity) {
  $keys = $this
    ->getIdentityId();
  return $entity
    ->getEntityTypeId() == $keys['entity_type'] && $entity
    ->id() == $keys['entity_id'];
}