Ejemplo n.º 1
0
 /**
  * @return static
  */
 public function withProductAttributes()
 {
     foreach ($this->entity->getProductAttributes() as $productAttribute) {
         $this->entityDTO->productAttributes[] = $this->dtoBuilderFactory->getProductAttributeDTOBuilder($productAttribute)->build();
     }
     return $this;
 }
Ejemplo n.º 2
0
 public function testCreate()
 {
     $attributeValue = $this->dummyData->getAttributeValue();
     $attribute = new Attribute();
     $attribute->setName('Test Attribute');
     $attribute->setDescription('Test attribute description');
     $attribute->setSortOrder(0);
     $attribute->addAttributeValue($attributeValue);
     $this->assertEntityValid($attribute);
     $this->assertSame('Test Attribute', $attribute->getName());
     $this->assertSame('Test attribute description', $attribute->getDescription());
     $this->assertSame(0, $attribute->getSortOrder());
     $this->assertSame($attributeValue, $attribute->getAttributeValues()[0]);
 }
Ejemplo n.º 3
0
 public function getAttribute()
 {
     $attribute = new Attribute();
     $attribute->setName('Test Attribute');
     $attribute->setDescription('Test Attribute Description');
     $attribute->setSortOrder(0);
     return $attribute;
 }
Ejemplo n.º 4
0
 private function setAttribute(Attribute $attribute)
 {
     $this->attribute = $attribute;
     $attribute->addAttributeValue($this);
 }