You are here

public function Registrant::setIdentity 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::setIdentity()
  2. 8 src/Entity/Registrant.php \Drupal\rng\Entity\Registrant::setIdentity()

Set associated identity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The identity to set.

Return value

\Drupal\rng\Entity\RegistrantInterface Returns registrant for chaining.

Overrides RegistrantInterface::setIdentity

1 call to Registrant::setIdentity()
Registrant::preSave in src/Entity/Registrant.php
If a value is set on the identity and blank on the registrant, copy values from identity to registrant, and vice-versa.

File

src/Entity/Registrant.php, line 88

Class

Registrant
Defines the registrant entity class.

Namespace

Drupal\rng\Entity

Code

public function setIdentity(EntityInterface $entity) {
  $this
    ->set('identity', [
    'entity' => $entity,
  ]);
  return $this;
}