code: public function addAttribute(AttributeInterface $attribute) {
          if(isset($this->attributes[$attribute->getName()]))
              trigger_error("Attribute " . $attribute->getName() . " already exists", E_USER_NOTICE);
  
          $this->attributes[ $attribute->getName() ] = $attribute;
      }
docs: Adds an attribute to the list
  Existing attributes are replaced.
  
  @param AttributeInterface $attribute