You are here

public function EventMeta::getCapacity in RNG - Events and Registrations 8

Gets configuration for maximum permitted registrations on this event.

Return value

integer|EventMetaInterface::CAPACITY_UNLIMITED Maximum amount of registrations (>= 0), or unlimited.

Overrides EventMetaInterface::getCapacity

1 call to EventMeta::getCapacity()
EventMeta::remainingCapacity in src/EventMeta.php
Calculates how many more registrations can be added to this event.

File

src/EventMeta.php, line 200

Class

EventMeta
Meta event wrapper for RNG.

Namespace

Drupal\rng

Code

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