You are here

class registration_handler_field_entity_registration_status in Entity Registration 8.2

Same name in this branch
  1. 8.2 src/registration_handler_field_entity_registration_status.php \Drupal\registration\registration_handler_field_entity_registration_status
  2. 8.2 modules/registration_views/includes/registration_handler_field_entity_registration_status.inc \registration_handler_field_entity_registration_status
  3. 8.2 modules/registration_views/src/registration_handler_field_entity_registration_status.php \Drupal\registration_views\registration_handler_field_entity_registration_status

@file Display registration status for host entity.

Hierarchy

Expanded class hierarchy of registration_handler_field_entity_registration_status

1 string reference to 'registration_handler_field_entity_registration_status'
registration_views_views_data_alter in modules/registration_views/registration_views.module
Implements hook_views_data_alter().

File

modules/registration_views/src/registration_handler_field_entity_registration_status.php, line 8
Display registration status for host entity.

Namespace

Drupal\registration_views
View source
class registration_handler_field_entity_registration_status extends views_handler_field_entity {
  function render($values) {
    $entity = $this
      ->get_value($values);
    list($entity_id) = entity_extract_ids($this->entity_type, $entity);
    $status = registration_status($this->entity_type, $entity_id);
    if (isset($status)) {
      return $status ? t('Open', array(), array(
        'context' => 'registration',
      )) : t('Closed', array(), array(
        'context' => 'registration',
      ));
    }
  }

}

Members