You are here

function apachesolr_views_handler_field_date::get_value in Apache Solr Views 7

Get the value that's supposed to be rendered.

This api exists so that other modules can easy set the values of the field without having the need to change the render method as well.

Parameters

object $values: An object containing all retrieved values.

string $field: Optional name of the field where the value is stored.

Overrides views_handler_field::get_value

File

handlers/apachesolr_views_handler_field_date.inc, line 9

Class

apachesolr_views_handler_field_date
Field handler for Solr date fields.

Code

function get_value($values, $field = NULL) {
  $value = parent::get_value($values, $field);
  if (isset($value)) {
    if (is_array($value)) {
      return strtotime($value[0]);
    }
    else {
      return strtotime($value);
    }
  }
}