/**
  * @return static
  */
 public function withProductAttributes()
 {
     foreach ($this->entity->getProductAttributes() as $productAttribute) {
         $this->entityDTO->productAttributes[] = $this->dtoBuilderFactory->getProductAttributeDTOBuilder($productAttribute)->withProduct()->build();
     }
     return $this;
 }
Пример #2
0
 public function testCreateDefaults()
 {
     $attribute = $this->dummyData->getAttribute();
     $attributeValue = new AttributeValue($attribute);
     $this->assertSame(null, $attributeValue->getSku());
     $this->assertSame(null, $attributeValue->getName());
     $this->assertSame(null, $attributeValue->getDescription());
     $this->assertSame(null, $attributeValue->getSortOrder());
     $this->assertSame($attribute, $attributeValue->getAttribute());
     $this->assertSame(0, count($attributeValue->getProductAttributes()));
 }