You are here

public function Registrant::hasIdentity in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/Entity/Registrant.php \Drupal\rng\Entity\Registrant::hasIdentity()
  2. 8 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

bool Whether the identity is the registrant.

Overrides RegistrantInterface::hasIdentity

File

src/Entity/Registrant.php, line 104

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'];
}