You are here

function facetapi_get_max_date in Facet API 6.3

Same name and namespace in other branches
  1. 7.2 facetapi.callbacks.inc \facetapi_get_max_date()
  2. 7 facetapi.callbacks.inc \facetapi_get_max_date()

Callback that returns the minimum value in the node table.

@todo Cache this value.

Parameters

$facet: An array containing the facet definition.

Return value

The minimum time in the node table.

1 string reference to 'facetapi_get_max_date'
facetapi_facetapi_facet_info in ./facetapi.module
Implements hook_facetapi_facet_info().

File

./facetapi.callbacks.inc, line 126
Callbacks referenced in hook implementations.

Code

function facetapi_get_max_date(array $facet) {
  $query = "SELECT MAX(%s) as max FROM {node} n WHERE n.status = 1";
  $result = db_result(db_query($query, array(
    $facet['name'],
  )));
  return $result;
}