/** * @param string $name * @param string $value */ public function setAttribute($name, $value) { $attribute = $this->getAttribute($name); if (!$attribute) { $this->attributes->append(new Attribute($name, $value, Attribute::QUOTE_DOUBLE)); } else { $attribute->setValue($value); } }