Owl\Repositories\Eloquent\StockRepository::getRankingWithCache PHP Метод

getRankingWithCache() публичный Метод

Get ranking data from cache.
public getRankingWithCache ( $limit ) : array
$limit int limit date
Результат array
    public function getRankingWithCache($limit)
    {
        $result = \Cache::get(self::RANKING_STOCK_KEY . $limit);
        if (!empty($result)) {
            return $result;
        }
        $result = $this->getRankingStockList($limit);
        $expiresAt = Carbon::now()->addMinutes(self::EXPIRE_AT_ADD_MINUTES);
        \Cache::put(self::RANKING_STOCK_KEY . $limit, $result, $expiresAt);
        return $result;
    }