You are here

public function EventMeta::getRegistrantsMaximum in RNG - Events and Registrations 8.2

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

File

src/EventMeta.php, line 256

Class

EventMeta
Meta event wrapper for RNG.

Namespace

Drupal\rng

Code

public function getRegistrantsMaximum() {
  if (isset($this
    ->getEvent()->{EventManagerInterface::FIELD_REGISTRANTS_CAPACITY})) {
    $field = $this
      ->getEvent()->{EventManagerInterface::FIELD_REGISTRANTS_CAPACITY};
    $maximum = $field->value;
    if ($maximum !== '' && is_numeric($maximum) && $maximum >= 0) {
      return $maximum;
    }
  }
  return EventMetaInterface::CAPACITY_UNLIMITED;
}