コード例 #1
0
 /**
  * @return object|null Returns an object with subscription information. Object includes the following:
  * name, monthly_cost, watermark, direct_upload, thumbs_per_hr_limit, file_size_limit, and thumb_size_limit.
  */
 public function getSubscription()
 {
     include_once $this->thumberClientPath . 'base-transaction.php';
     if (isset(self::$subscription)) {
         return self::$subscription;
     } else {
         $resp = $this->sendRequest(new ThumberBaseTransaction(), 'GET', self::ThumberSubscriptionPath);
         if (!array_key_exists('error', $resp)) {
             self::$subscription = json_decode($resp['body']);
             return self::$subscription;
         } else {
             $this->handleError('Failed to retrieve subscription: ' . $resp['body']);
             return null;
         }
     }
 }