public function Registrant::setIdentity in RNG - Events and Registrations 3.x
Same name and namespace in other branches
- 8.2 src/Entity/Registrant.php \Drupal\rng\Entity\Registrant::setIdentity()
 - 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\EntityCode
public function setIdentity(EntityInterface $entity) {
  $this
    ->set('identity', [
    'entity' => $entity,
  ]);
  return $this;
}