Example #1
0
 /**
  * Called before sending a request
  * @param $queryType
  * @throws ApiException
  * @throws RateLimitException
  * @throws ModelException
  */
 protected function beforeRequest($queryType)
 {
     //Reset the options
     $this->_owner->beforeRequest();
     if ($queryType == ApiHelper::SAVE || ApiHelper::UPDATE) {
         $this->_setBody($this->_owner->getBody());
     }
     if (App::getInstance()->getRateLimit()->hasExceeded()) {
         throw new RateLimitException('Out of limits');
     }
     if ($queryType == ApiHelper::PAGE) {
         $this->_addHeaders(['page' => $this->_owner->getPagination()->page, 'pagesize' => $this->_owner->getPagination()->pageSize]);
     }
     $this->_addLog();
 }