public function addAttribute(AttributeInterface $attribute) { $this->attributes[$attribute->name()] = $attribute; return $this; }