Locker\Data\Analytics\Analytics::timedGrouping PHP Method

timedGrouping() public method

Gets timed grouping of statements.
public timedGrouping ( String $lrs_id, array $options ) : [[String
$lrs_id String Id of the LRS.
$options array
return [[String
    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'];
    }