Example #1
0
 /**
  * Saves the result from the given api request into cache.
  *
  * @param RequestBag $requestBag
  * @param mixed      $result
  *
  * @return bool
  */
 public static function saveResult(RequestBag $requestBag, $result)
 {
     // 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->saveCallbackResult($result);
 }