/** * @return string */ public function execute() { $photo = new Photo(); $photo->setTags($this->photoDTO->getTags()); $photo->setThumbnails($this->photoDTO->getUrls()); return $this->repository->store($photo); }
/** * @param PhotoDocument $photoDocument * @return Photo */ public function buildPhotoEntity(PhotoDocument $photoDocument) { $photo = new Photo(); $photo->setThumbnails($photoDocument->getThumbnails()); $photo->setId($photoDocument->getId()); $photo->setTags($this->buildTagData($photoDocument->getTags())); return $photo; }
/** * @param int $howManyPhotos * @param array $tagNames */ protected function loadFixture($howManyPhotos, array $tagNames) { for ($i = 1; $i <= $howManyPhotos; $i++) { $thumbnails[Photo::THUMBNAIL_SMALL] = uniqid('small'); $thumbnails[Photo::THUMBNAIL_STANDARD] = uniqid('standard'); $photo = new Photo(); $photo->setTags($tagNames); $photo->setThumbnails($thumbnails); $this->repository->store($photo); } }