You are here

public function RngRegistrationCreationSubscriber::missingRegistrationType in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/EventSubscriber/RngRegistrationCreationSubscriber.php \Drupal\rng\EventSubscriber\RngRegistrationCreationSubscriber::missingRegistrationType()

Determines if there are no registration types configured.

Parameters

\Drupal\rng\Event\RegistrationAccessEvent $event:

File

src/EventSubscriber/RngRegistrationCreationSubscriber.php, line 66

Class

RngRegistrationCreationSubscriber
Class RngRegistrationCreationSubscriber.

Namespace

Drupal\rng\EventSubscriber

Code

public function missingRegistrationType(RegistrationAccessEvent $event) {
  $meta = $this
    ->getMeta($event
    ->getContext());
  if (!$meta
    ->getRegistrationTypeIds()) {
    $event
      ->setAccess(FALSE);
  }
}