public function getFromQuery(Provider $provider, Query $query) { $queryString = $query->getQuery(); $url = $this->buildUrl($queryString); $data = json_decode($this->getUrl($url)); $gifData = $data->data; $gif = new Gif(); $gif->setUrl($gifData->image_original_url); return $gif; }
/** * Remove query * * @param Query $query */ public function removeQuery(Query $query) { $query->setProvider(null); $this->queries->removeElement($query); }