public function testFind()
 {
     $originalOption = $this->setupOption();
     $this->setCountLogger();
     $option = $this->optionRepository->findOneById($originalOption->getId());
     $this->visitElements($option->getOptionProducts());
     $this->visitElements($option->getOptionValues());
     $this->visitElements($option->getTags());
     $this->assertEquals($originalOption->getId(), $option->getid());
     $this->assertSame(4, $this->getTotalQueries());
 }
示例#2
0
 /**
  * @param UuidInterface $tagId
  * @param UuidInterface $optionId
  * @throws EntityNotFoundException
  */
 public function removeOption(UuidInterface $tagId, UuidInterface $optionId)
 {
     $option = $this->optionRepository->findOneById($optionId);
     $tag = $this->tagRepository->findOneById($tagId);
     $tag->removeOption($option);
     $this->tagRepository->update($tag);
 }
示例#3
0
 /**
  * @param UuidInterface $id
  * @return Option
  * @throws EntityNotFoundException
  */
 public function findOneById(UuidInterface $id)
 {
     return $this->optionRepository->findOneById($id);
 }