Add attribute definition

@param Attribute $attribute

@return ComplexEntity
487766
public function addAttribute(Attribute $attribute): ComplexEntity
	{
		$this->attributesCollection = $this->getAttributes()->addAttribute($attribute);
		return $this;
	}
1006936
public function addAttributes(array $attributes): self
    {
        $this->attributes = array_unique(array_merge($this->attributes, $attributes));

        return $this;
    }
813901
public function attribute( $attribute, $value )
    {
        if ( null === $value )
        {
            unset( $this->attributes[ $attribute ] );
        } else {
            $this->attributes[ $attribute ] = $value;
        }

        return $this;
    }
225603
protected function takeAttributeFromDOM($attribute)
    {
        switch ($attribute->localName) {
        case 'state':
            $this->_state = $attribute->nodeValue;
            break;
        default:
            parent::takeAttributeFromDOM($attribute);
        }
    }
1259588
public function addAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
718573
public function addVisible($attributes = null)
    {
        $visible = array_merge(
            $this->getVisible(),
            is_array($attributes) ? $attributes : func_get_args()
        );

        $this->updateSchema('visible', $visible, true, true, false);

        return $this;
    }
816873
public function withAttribute($attribute, $value)
    {
        $new = $this->psrRequest->withAttribute($attribute, $value);
        return new self($new, $this->originalRequest);
    }
653230
public function add(array $attributes = array())
    {
        if (!$this->contains($attributes)) {
            $this->model->getModel()->newInstance($attributes)->save();
            $this->cache->forget($this->cacheKey);
        }
        return $this;
    }
1106645
public function setAttribute($attribute, $value)
    {
        Arr::set($this->attributes, $attribute, $value);

        return $this;
    }
387932
public function allowAttribute($attribute)
    {
        if (is_array($attribute))
        {
            foreach ($attribute as $attrib)
                $this->allowed_attributes[$attrib] = true;
        }
        else
            $this->allowed_attributes[$attribute] = true;
        return $this;
    }
46067
protected function setEntityAttributeValue(Attribute $attribute, $value)
    {
        if (! is_null($value) && ! $value instanceof Value) {
            $model = Attribute::getTypeModel($attribute->getAttribute('type'));
            $instance = new $model();

            $instance->setAttribute('entity_id', $this->getKey());
            $instance->setAttribute('entity_type', $this->getMorphClass());
            $instance->setAttribute($attribute->getForeignKey(), $attribute->getKey());
            $instance->setAttribute('content', $value);

            $value = $instance;
        }

        return $this->setRelation($attribute->getAttribute('slug'), $value);
    }
74039
public function addAttributes($attributes, $html = [])
    {
        if (!empty($attributes)) {
            foreach ($attributes as $key => $value) {
                if (!is_null($value)) {
                    $html[] = $key.'="'.Html::entities($value).'"';
                }
            }
        }

        return (count($html) > 0) ? ' '.implode(' ', $html) : '';
    }
674739
public function addParameter($attribute)
    {
        $attribute = array_change_key_case($attribute, CASE_LOWER);
        $this->parameters[$attribute['name']] = $attribute['value'];
    }
1352513
public function setAttributes(array $attributes)
    {
        $this->attributes = [];
        foreach ($attributes as $attribute => $value) {
            $this->addAttribute($attribute, $value);
        }

        return $this;
    }
11442
public function setAttribute(string $attribute, string $value = '')
    {
        $this->htmlAttributes->setAttribute($attribute, $value);

        return $this;
    }
176593
public function add($input, $attribute = null)
    {
        $this->input = $input;
        static::$rules[$input] = [];

        if (isset($attribute)) {
            static::$attributes[$input] = $attribute;
        }

        return $this;
    }
293661
public function addAttribute($attribute, $value)
    {
        $value = is_array($value) ? $value : [$value];

        if (!isset($this->attributes[$attribute])) {
            $this->attributes[$attribute] = [];
        }
        foreach ($value as $attrValue) {
            $this->attributes[$attribute][] = $attrValue;
        }

        return $this;
    }