You are here

function _feedapi_get_stat in FeedAPI 6

Same name and namespace in other branches
  1. 5 feedapi.module \_feedapi_get_stat()

Return the type-specific statistics data

@name $only_val If TRUE, only the values are returned, no more.

Parameters

$id: A numerical id

$type: Name of the type (variable)

Return value

$only_val = FALSE -> array("timestamp" => array(), "time" => array(), "value" => array());

1 call to _feedapi_get_stat()
feedapi_admin_overview in ./feedapi.admin.inc
Provide a UI for overviewing the existing feeds

File

./feedapi.module, line 1567
Handle the submodules (for feed and item processing) Provide a basic management of feeds

Code

function _feedapi_get_stat($id, $type, $only_val = FALSE) {
  $stat = array();
  $result = db_query("SELECT timestamp, time, value FROM {feedapi_stat} WHERE type = '%s' AND id = %d", $type, $id);
  while ($row = db_fetch_array($result)) {
    if ($only_val) {
      $stat[] = $row['value'];
    }
    else {
      foreach (array(
        'timestamp',
        'time',
        'value',
      ) as $member) {
        $stat[$member][] = $row[$member];
      }
    }
  }
  return $stat;
}