Adds an unmanaged custom attribute to the element or gets an attribute either from the list
of custom attributes.

@param string $name The name of the attribute.
@param string $value The value of the attribute.
@throws SsmlException
@return static
3851
public function attr(string $name, string $value = null)
    {
        if ($value === null) {
            if (isset($this->customAttributes[$name])) {
                return $this->customAttributes[$name];
            }

            throw new SsmlException('Unknown attribute ' . $name . ' in class ' . get_class($this));
        }

        $this->customAttributes[$name] = $value;
        return $this;
    }
602008
public function setAttribute(string $name, $value)
    {
        if (array_key_exists($name, $this->attributes)) {
            throw new AttributeOverrideException($this, $name);
        }

        $this->attributes[$name] = $value;
    }
134463
public function attr(string $name, $value = null) {
        if (is_null($value)) {
            return $this->getAttr($name);
        } else {
            return $this->setAttr($name, $value);
        }
    }
905702
public function setAttribute($name, $value)
    {
        if ($this->hasAttribute($name)) {
            $this->$name = $value;
        } else {
            throw new InvalidParamException(get_class($this).' '.\Yii::t('skeeks/cms',
                    'has no attribute named "{name}".', ['name' => $name]));
        }
    }
393820
public function setAttribute($name, $value)
    {
        if (isset($this->{$name})) {
            $this->{$name} = $value;
        } else {
            throw new InvalidParamException(get_class($this).' has no attribute named "'.$name.'".');
        }
    }
518074
public function addVarAttr($name, $value)
    {
        if (!in_array($name, $this->varAttr)) {
            $this->varAttr[$name] = $value;
        }
        return $this;
    }
551840
public function setAttribute($name, $value = null)
    {
        $this->getAttributes()->set($name, $value);
        return $this;
    }
1366451
public function setAttributes($name, $value = null) 
	{
		Argument::i()
			->test(1, 'string', 'array')
			->test(2, 'scalar', 'null');
		
		if(is_array($name)) {
			$this->attributes = $name;
			return $this;
		}
		
		$this->attributes[$name] = $value;
		return $this;
	}
1281562
public function add(string $name, $value)
    {
        if (is_array($name)) {
            foreach ($name as $key => $value) {
                $this->data[$key] = $value;
            }

            return $this;
        }

        $this->data[$name] = $value;

        return $this;
    }
698806
public function setAttribute($name, $value) {
		if(!isset($this->payload['params']['Data'])) {
			$this->payload['params']['Data'] = array();
		}

		if(!isset($this->payload['params']['Data']['Attributes'])) {
			$this->payload['params']['Data']['Attributes'] = array();
		}
		$this->payload['params']['Data']['Attributes'][$name] = Trustly_Data::ensureUTF8($value);
		return $value;
	}
249521
public function setAttribute(string $name, string $value) : Form
    {
        $this->getTag()->setAttribute($name, $value);

        return $this;
    }
598695
public function addAttribute($name, $value)
    {
        if ($name == 'Pattern') {
            $value = $this->sanitizePattern($name, $value);
        }
        $this->attributes[$name] = $value;

        return $this;
    }
1289829
public function forgetValue($name, $value)
    {
        if ($this->has($name)) {
            $attr = $this->getAttr($name);

            $attr->forgetValue($value);
        }

        return $this;
    }
357969
public function assignAttribute($name, $value)
	{
		$table = static::table();
		if (!is_object($value)) {
			if (array_key_exists($name, $table->columns)) {
				$value = $table->columns[$name]->cast($value, static::connection());
			} else {
				$col = $table->getColumnByInflectedName($name);
				if (!is_null($col)){
					$value = $col->cast($value, static::connection());
				}
			}
		}

		// convert php's \DateTime to ours
		if ($value instanceof \DateTime) {
			$value = new DateTime($value->format('Y-m-d H:i:s T'));
		}

		// make sure DateTime values know what model they belong to so
		// dirty stuff works when calling set methods on the DateTime object
		if ($value instanceof DateTime) {
			$value->attributeOf($this, $name);
		}

		$this->_attributes[$name] = $value;
		$this->flagDirty($name);
		return $value;
	}
171286
public function prependAttribute($name, ...$value)
    {
        list($current_value, $separator) = $this->manipulateAttribute($name, $value);

        foreach ($value as $attribute_value) {
            array_unshift($current_value, $attribute_value);
        }

        $this->updateAttribute($name, $current_value, $separator);

        return $this;
    }
293299
public function set($name, $value = null)
    {
        if (is_string($name)) {
            $name = $this->cleanAttributeName($name);
            if ($value === null && isset($this->props[$name])) {
                unset($this->props[$name]);
            } elseif ($value !== null) {
                $this->props[$name] = $value;
            }
        }

        return $this;
    }
445609
public function offsetSet($name, $value)
    {
        if (!$this->hasSchema($name)) {
            throw new \RuntimeException('Invalid attribute name: ' . $name);
        }
        parent::offsetSet($name, $value);
        return $this;
    }