/** * * @return array */ public function getDatasetUsers() { $cacheKey = 'percentile/users_connections/' . ($this->account ? $this->account->getName() : ''); return $this->cacheGet($cacheKey, function () { $array = $this->cacheGet('rawpercentile/users_connections', function () { $conn = $this->controller->getConnection(); $sql = "SELECT " . time() . " - `lastaccess` as n FROM `tokens` ORDER BY n"; $array = []; foreach ($conn->query($sql) as $row) { $array[] = floor($row['n'] / 86400); } return $array; }, 3600); return $this->doCalcPercentiles($array); }, 900); }
protected function render($view, array $parameters = array(), Response $response = null) { if ($this->token) { $parameters['owner'] = $this->isOwner; $parameters['user'] = $this->token; $parameters['token'] = $this->token; $parameters['code'] = $this->token->getCode(); $parameters['account'] = $this->account; $parameters['characters'] = $this->characters; } return parent::render($view, $parameters, $response); }