You are here

registration_handler_field_entity_capacity_used.php in Entity Registration 8

Same filename and directory in other branches
  1. 8.2 src/registration_handler_field_entity_capacity_used.php

Display maximum slots for an entity.

File

src/registration_handler_field_entity_capacity_used.php
View source
<?php

namespace Drupal\registration;


/**
 * @file
 * Display maximum slots for an entity.
 */
class registration_handler_field_entity_capacity_used extends views_handler_field_numeric {
  function render($values) {
    $entity_id = $this
      ->get_value($values);
    $table = $this->table;
    $alias = $this->field_alias;
    $slots_used = (int) registration_event_count($table, $entity_id);
    $values->{$alias} = $slots_used;
    return parent::render($values);
  }

}

Classes

Namesort descending Description
registration_handler_field_entity_capacity_used @file Display maximum slots for an entity.