public function timedGrouping($lrs_id, array $options)
{
$filters = $this->addDateFilters($options, $this->setFilter($this->constructFilter($options)));
// Gets the type option.
$type = $this->setType($this->getOption($options, 'type', 'time'));
// Gets the interval option.
$interval = $this->getOption($options, 'interval', $this->setInterval(), function ($val) {
return $this->setInterval($val);
});
// Gets the filtered data.
$data = $this->query->timedGrouping($lrs_id, $filters, $interval, $type);
$data = $data ? $data : ['result' => null];
// Attempts to return the filtered data.
if (isset($data['errmsg'])) {
throw new Exceptions\Exception($data['errmsg']);
}
return $data['result'];
}