You are here

public function RngRegistrationCreationSubscriber::remainingCapacity in RNG - Events and Registrations 8.2

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

Determines if there is any remaining capacity.

Parameters

\Drupal\rng\Event\RegistrationAccessEvent $event:

File

src/EventSubscriber/RngRegistrationCreationSubscriber.php, line 90

Class

RngRegistrationCreationSubscriber
Class RngRegistrationCreationSubscriber.

Namespace

Drupal\rng\EventSubscriber

Code

public function remainingCapacity(RegistrationAccessEvent $event) {
  $meta = $this
    ->getMeta($event
    ->getContext());
  if (!$meta
    ->allowWaitList() && $meta
    ->remainingRegistrantCapacity() < 1) {
    $event
      ->setAccess(FALSE);
  }
}