LMongo\Query\Builder::getCached PHP Method

getCached() public method

Execute cached query.
public getCached ( array $columns = [] ) : array
$columns array
return array
    public function getCached($columns = array())
    {
        list($key, $minutes) = $this->getCacheInfo();
        // If the query is requested ot be cached, we will cache it using a unique key
        // for this database connection and query statement, including the bindings
        // that are used on this query, providing great convenience when caching.
        $cache = $this->connection->getCacheManager();
        $callback = $this->getCacheCallback($columns);
        return $cache->remember($key, $minutes, $callback);
    }
Builder