You are here

public function Registration::setEvent in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 8 src/Entity/Registration.php \Drupal\rng\Entity\Registration::setEvent()
  2. 3.x src/Entity/Registration.php \Drupal\rng\Entity\Registration::setEvent()

Set associated event.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: An entity that has an associated event.

Return value

\Drupal\rng\Entity\RegistrationInterface Returns registration for chaining.

Overrides RegistrationInterface::setEvent

File

src/Entity/Registration.php, line 94

Class

Registration
Defines the registration entity class.

Namespace

Drupal\rng\Entity

Code

public function setEvent(ContentEntityInterface $entity) {
  $this
    ->set('event', [
    'entity' => $entity,
  ]);
  return $this;
}