public function addAttribute(AttributeInterface $attribute) { if (!$this->attributes->contains($attribute)) { $this->attributes->add($attribute); } return $this; }