{@inheritdoc}

@param array $attributes

@throws \Ems\Contracts\Core\Errors\Unsupported

@return self
768151
public function fill(array $attributes = [])
    {
        foreach ($attributes as $property => $value) {
            if (isset(static::$propertyMap[static::class][$property])) {
                $this->{$property} = $value;
                continue;
            }

            if (isset(static::$setterMap[static::class][$property])) {
                $this->__set($property, $value);
                continue;
            }

            if (!isset(static::$aliases[static::class][$property])) {
                $this->constraints->__set($property, $value);
                continue;
            }

            $alias = static::$aliases[static::class][$property];

            if ($alias instanceof Closure) {
                $alias($this, $property, $value);
                continue;
            }

            if (property_exists($this, $alias)) {
                $this->{$alias} = $value;
                continue;
            }

            // Because constraints needs to be removed on
            // false values, they can only be aliased with
            // closures (callables) so this line is only
            // included to document that
            // $this->__set($alias, $value);
        }

        return $this;
    }
848274
public function withAttributes(array $attributes)
    {
        $clone = clone $this;

        foreach ($attributes as $name => $value) {
            $clone->dom->documentElement->setAttribute($name, $value);
        }

        return $clone;
    }
534545
public function replicate(array $attributes = [])
    {
        $groupPrefix = isset($attributes['groupPrefix']) ? $attributes['groupPrefix'] : '';

        return new static($this->parent, $this->namer, $this->groupName($groupPrefix));
    }
339819
public function setTableAttributes(array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $this->tableAttributes[$attribute] = $value;
        }

        return $this;
    }
799659
public function update($attributes)
    {
        if (!empty($attributes)) {
            foreach ($attributes as $attribute => $value) {
                $this->set($attribute, $value);
            }
        }

        return $this;
    }
1241398
public function removeAttribute($attribute)
    {
        if (array_key_exists($attribute, $this->attributes)) {
            unset($this->attributes[$attribute]);
        }

        return $this;
    }
1072925
public function withAttributes(array $attributes = []): Element
    {
        $this->attributes = array_merge(
            $this->attributes,
            $attributes
        );

        return $this;
    }
749250
public function setLinkAttributes($attributes)
    {
        if (! is_array($attributes)) {
            $attributes = [$attributes];
        }

        $this->link_attributes = $attributes;

        return $this;
    }
74884
protected function setUnfillableAttributes(array $attributes = [])
    {
        if ( ! empty( $attributes )) {
            $keysToFill = array_diff(array_keys($attributes), $this->fillable);
            foreach ($keysToFill as $key) {
                $this->setAttribute($key, $attributes[$key]);
            }
        }
    }
1325635
public function remove($attributes)
    {
        foreach ((array) $attributes as $attribute) {
            unset($this->defaults[$attribute],
                $this->types[$attribute],
                $this->requires[$attribute],
                $this->notNullables[$attribute]);
        }

        return $this;
    }
765171
public function reset(...$attributes)
    {
        foreach ($attributes as $attribute) {
            if ($this->has($attribute)) {
                $attribute = $this->resolveAttributeName($attribute);
                unset($this->attributes[$attribute]);
            }
            $this->batches->add(new Batch(Batch::TYPE['REMOVE_ALL'], $attribute));
        }

        return $this;
    }
63081
public function setAttributes(array $attributes = null)
    {
        $this->attributes = array_merge($this->attributes, $attributes);
        return $this;
    }
491708
public static function init(array $attributes) {
        $obj = new Attributes;
        foreach ($attributes as $attribute) {
            $obj->{$attribute->key} = $attribute;
        }
        return $obj;
    }
563250
public function setAttributes($attributes)
    {
        if (!is_array($attributes) && !$attributes instanceof Traversable)
        {
            throw new InvalidArgumentException(sprintf(
                'Event attributes must be an array or an object implementing the Traversable interface; received "%s"', gettype($attributes)
            ));
        }

        //Set the arguments.
        foreach ($attributes as $key => $value) {
            $this->set($key, $value);
        }

        return $this;
    }
1226748
public function forceCreate(array $attributes)
    {
        $instance = $this->model->newInstance()->setConnection(
            $this->query->getConnection()->getName()
        );

        return $this->model->unguarded(function () use ($attributes, $instance) {
            return $instance->create($attributes);
        });
    }
1088997
public function addAttributes($attributes)
    {
        foreach ($attributes as $name => $value) {
            if (!is_array($value)) {
                $value = [$value];
            }
            parent::attr($name, ...$value);
        }

        return $this;
    }
903430
public function set_raw_attributes( array $attributes, $sync = false ) {
		$this->attributes = $attributes;

		if ( $sync ) {
			$this->sync_original();
		}

		return $this;
	}