You are here

function civicrm_entity_views_extras_handler_event_is_full::render in CiviCRM Entity 7.2

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

modules/civicrm_entity_views_extras/views/civicrm_entity_views_extras_handler_event_is_full.inc, line 5

Class

civicrm_entity_views_extras_handler_event_is_full

Code

function render($values) {
  if (!civicrm_initialize()) {
    return;
  }
  try {
    $event = civicrm_api3('Event', 'getsingle', array(
      'return.is_full' => 1,
      'id' => $values->id,
    ));
    if (!empty($event['is_full'])) {
      return 1;
    }
    else {
      return 0;
    }
  } catch (CiviCRM_API3_Exception $e) {
    drupal_set_message($e
      ->getMessage(), 'error');
    return;
  }
}