/** * Queryes the groupon API for results * * @param Deal|Divison|WebClient $type * */ public function query($type) { if (!$this->Gdriver instanceof APQ\Driver\GDriver) { throw new \Exception("Driver object for API connection not recognized."); } if ($this->getWebClient() !== null && $this->getWebClient()->getIP() !== null) { $this->Gdriver->addHeader("X-Forwarded-For", $this->getWebClient()->getIP()); } $this->Gdriver->setUrl($type->getUrl()); $this->Gdriver->connect(); return $this->Gdriver->get(); }