/** * @param Attribute $attribute * @return $this */ public function addAttribute(Attribute $attribute) { $this->attributes[$attribute->getName()] = $attribute; return $this; }