/** * @return static */ public function withTags() { foreach ($this->entity->getTags() as $tag) { $this->entityDTO->tags[] = $this->dtoBuilderFactory->getTagDTOBuilder($tag)->build(); } return $this; }
public function handle(GetTagsByIdsQuery $query) { $tags = $this->tagService->getTagsByIds($query->getRequest()->getTagIds()); foreach ($tags as $tag) { $query->getResponse()->addTagDTOBuilder($this->dtoBuilderFactory->getTagDTOBuilder($tag)); } }
/** * @return static */ public function withTag() { $tag = $this->entity->getTag(); if (!empty($tag)) { $this->entityDTO->tag = $this->dtoBuilderFactory->getTagDTOBuilder($tag)->build(); } return $this; }
public function handle(ListTagsQuery $query) { $paginationDTO = $query->getRequest()->getPaginationDTO(); $pagination = new Pagination($paginationDTO->maxResults, $paginationDTO->page); $tags = $this->tagService->getAllTags($query->getRequest()->getQueryString(), $pagination); $query->getResponse()->setPaginationDTOBuilder($this->dtoBuilderFactory->getPaginationDTOBuilder($pagination)); foreach ($tags as $tag) { $query->getResponse()->addTagDTOBuilder($this->dtoBuilderFactory->getTagDTOBuilder($tag)); } }
/** * @param PricingInterface $pricing * @return static */ public function withTagsAndOptions(PricingInterface $pricing) { foreach ($this->entity->getTags() as $tag) { $this->entityDTO->tags[] = $this->dtoBuilderFactory->getTagDTOBuilder($tag)->withImages()->withOptions($pricing)->withTextOptions()->build(); } $this->loadOptionsFromTags(); return $this; }
public function handle(GetTagQuery $query) { $tag = $this->tagService->findOneById($query->getRequest()->getTagId()); $query->getResponse()->setTagDTOBuilder($this->dtoBuilderFactory->getTagDTOBuilder($tag)); }