You are here

public function EventMeta::getRegistrantCapacity in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/EventMeta.php \Drupal\rng\EventMeta::getRegistrantCapacity()

Gets configuration for maximum permitted registrants on this event.

Return value

int|EventMetaInterfaceCAPACITY_UNLIMITED Maximum amount of registrants (>= 0), or unlimited.

Overrides EventMetaInterface::getRegistrantCapacity

1 call to EventMeta::getRegistrantCapacity()
EventMeta::remainingRegistrantCapacity in src/EventMeta.php
Calculates how many more registrants can be added to this event.

File

src/EventMeta.php, line 236

Class

EventMeta
Meta event wrapper for RNG.

Namespace

Drupal\rng

Code

public function getRegistrantCapacity() {
  $capacity = (int) $this
    ->getEvent()->{EventManagerInterface::FIELD_REGISTRANTS_CAPACITY}->value;
  if ($capacity != '' && is_numeric($capacity) && $capacity >= 0) {
    return $capacity;
  }
  return EventMetaInterface::CAPACITY_UNLIMITED;
}