Elcodi\Component\Product\Entity\Product::addAttribute PHP Метод

addAttribute() публичный Метод

Adds an attribute if not already in the collection.
public addAttribute ( Elcodi\Component\Attribute\Entity\Interfaces\AttributeInterface $attribute )
$attribute Elcodi\Component\Attribute\Entity\Interfaces\AttributeInterface Attribute
    public function addAttribute(AttributeInterface $attribute)
    {
        if (!$this->attributes->contains($attribute)) {
            $this->attributes->add($attribute);
        }
        return $this;
    }