/**
  * @param PricingInterface $pricing
  * @return static
  */
 public function withOptionProducts(PricingInterface $pricing)
 {
     foreach ($this->entity->getOptionProducts() as $optionProduct) {
         $this->entityDTO->optionProducts[] = $this->dtoBuilderFactory->getOptionProductDTOBuilder($optionProduct)->withProduct($pricing)->build();
     }
     return $this;
 }
Example #2
0
 public function testCreateDefaults()
 {
     $option = new Option();
     $this->assertSame(0, count($option->getTags()));
     $this->assertSame(0, count($option->getOptionProducts()));
     $this->assertSame(0, count($option->getOptionValues()));
     $this->assertTrue($option->getType()->isSelect());
 }