public function __construct(Product $product, Attribute $attribute, AttributeValue $attributeValue) { $this->setId(); $this->setCreated(); $this->product = $product; $this->attribute = $attribute; $this->attributeValue = $attributeValue; $product->addProductAttribute($this); $attribute->addProductAttribute($this); $attributeValue->addProductAttribute($this); }