public function setAttribute(Attribute &$attr) { $name = $attr->getName(); if (isset($this->attributes[$name])) { $this->attributes[$name]->updateValue($attr); } else { $this->attributes[$name] = clone $attr; } return $this->attributes[$name]; }
public function updateValue(Attribute &$attr) { $this->value = $attr->getValue(); }