You are here

function commerce_file_handler_field_license_expiration::render in Commerce File 7

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field_date::render

File

views/handlers/commerce_file_handler_field_license_expiration.inc, line 41
Field handler for a license expiration.

Class

commerce_file_handler_field_license_expiration
Field handler for license expiration.

Code

function render($values) {
  $entity = $this
    ->_get_entity($values);
  if (!empty($entity)) {
    if (!isset($entity->{$this->real_field})) {

      // unlimited duration if no expiration is defined
      return !empty($this->options['unlimited_text']) ? $this->options['unlimited_text'] : NULL;
    }

    // set value and render as date
    $values->{$this->field_alias} = $entity->{$this->real_field};
    return parent::render($values);
  }
}