private function addSerie($info) { $serie = new Serie(); $serie->setIdTrakt($info['ids']['trakt'])->setIdTvdb($info['ids']['tvdb'])->setSlug($info['ids']['slug'])->setTitle($info['title'])->setYear($info['year'])->setFirstAired(new \DateTime($info['first_aired']))->setNetwork($info['network'])->setRuntime($info['runtime'])->setAirDay($info['airs']['day'])->setAirTime($info['airs']['time'])->setSummary($info['overview'])->setUpdatedAt(new \DateTime($info['updated_at']))->setStatus($info['status'])->setRating($info['rating']); $this->insertImage($serie, $info['images']); $this->persistAndSave($serie); }
public function imageAction(Serie $serie, $type, $format) { $image = $serie->getImagesByTypeAndFormat($type, $format); if ($image) { $response = $this->render('AppBundle:Serie:image.html.twig', array('image' => $image[0])); // $response->setPublic(); // $response->setSharedMaxAge(600); return $response; } }