/** * @Route("/", name="home") * @Method("GET") * @Template("FreyrGalleryWebBundle:Home:index.html.twig") */ public function getHomeAction() { /** @var PhotoRepositoryInterface $photoRepository */ $photoRepository = $this->get('freyr.gallery.repository.photo'); $getTagsInteractor = new GetTags($photoRepository); return ['tags' => $getTagsInteractor->execute()]; }
/** * @Route("/photos", name="api.photos.get") * @Method("GET") * @return JsonResponse */ public function getPhotosAction() { /** @var MongoDBPhotoRepository $photoRepository */ $photoRepository = $this->get('freyr.gallery.repository.photo'); $tagsInteractor = new GetTags($photoRepository); $photosInteractor = new GetPhotosByTags($tagsInteractor->execute()->asArray(), $photoRepository); $response = $photosInteractor->execute(); return new JsonResponse($response); }
/** * */ public function testInitialise() { $this->loadFixture(100, ['uno', 'duo', 'three', 'tag test', 'luzik']); $interactor = new GetTags($this->repository); $interactor->execute(); }