Example #1
0
 /**
  * Tries to get the result for the given api request from the cache.
  *
  * @param RequestBag $requestBag
  *
  * @return bool|mixed False or the actual result from cache.
  */
 public static function getFromCache(RequestBag $requestBag)
 {
     // check if we have cache in settings
     if (!$requestBag->getApiConfig()->get('Cache', false) || $requestBag->getMethodData()['cache']['ttl'] <= 0) {
         return false;
     }
     $instance = new self($requestBag);
     return $instance->getCallbackResultFromCache();
 }