Add a field to the node type

@param array $attributes
@return Eloquent
182554
public function addField(array $attributes)
    {
        $field = $this->fields()->create($attributes);

        $this->save();

        return $field;
    }
150434
public function add(array $attributes = array())
    {
        $item = MenuItem::make($attributes);

        $this->items[] = $item;

        return $item;
    }
1147987
public static function fromArray(array $attributes) {
		unset($attributes['id']);
		
		$attributesObject = new self();
		
		foreach ($attributes as $key => $value) {
			$attributesObject->add($key, $value);
		}
		
		return $attributesObject;
	}
879958
public function addItem(array $attributes = []){
        if($item = $this->getItem(collect($attributes)->except(['quantity']))){
            $item->quantity += $attributes['quantity'];
            $item->save();
            return $item;
        }
        return $this->items()->create($attributes);
    }
417360
protected function addDateAttributesToArray(array $attributes)
    {
        foreach ($this->getDates() as $key) {
            if (! isset($attributes[$key])) {
                continue;
            }

            $attributes[$key] = $this->serializeDate(
                $this->asDateTime($attributes[$key])
            );
        }

        return $attributes;
    }
290378
public function createElement(array $attributes)
    {
        $meta = $this->ownerDocument->createElement('meta');

        $name = null;
        foreach ($attributes as $key => $value) {
            $meta->setAttribute($key, $value);
        }

        $this[] = $meta;

        return $meta;
    }
154330
public function addAddress(array $attributes)
    {
        $attributes = $this->loadAddressAttributes($attributes);

        return $this->addresses()->updateOrCreate($attributes);
    }
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) : '';
    }
491708
public static function init(array $attributes) {
        $obj = new Attributes;
        foreach ($attributes as $attribute) {
            $obj->{$attribute->key} = $attribute;
        }
        return $obj;
    }
1133756
public function setAttributes($attributes)
    {
        foreach ($attributes as $attribute => $value) {
            if ($attribute === 'class') {
                $this->addClass($value);
                continue;
            }

            if (is_int($attribute)) {
                $attribute = $value;
                $value = '';
            }

            $this->setAttribute($attribute, (string) $value);
        }

        return $this;
    }
972832
public function setAttributes(Array $attributes) {

		foreach($attributes as $k => $v) {
			$this->setAttribute($k, $v);
		}
		return $this;

	}
363529
public function append($attributes)
    {
        $this->appends = array_unique(
            array_merge($this->appends, is_string($attributes) ? func_get_args() : $attributes)
        );

        return $this;
    }
533907
public function ou(array $attributes = [])
    {
        $model = $this->schema->organizationalUnitModel();

        return (new $model($attributes, $this->query))
            ->setAttribute($this->schema->objectClass(), [
                $this->schema->top(),
                $this->schema->organizationalUnit(),
            ]);
    }
739165
public function createInput(array $attributes = [])
    {
        $field = new Components\Form\Elements\Input();

        if (count($attributes)) {
            foreach ($attributes as $name => $value) {
                $field->attributes->addAttribute($name, $value);

                if ($name === 'name') {
                    $this->entity->setEntityName('input-' . $value);

                    if ( ! array_key_exists('id', $attributes)) {
                        $field->attributes->setAttributeId('input-' . $value);
                    }
                }
            }
        }

        $this->childNodes->push($field);

        return $this->childNodes->last();
    }
1009243
public function create(array $attributes)
	{
		$group = $this->createModel();
		$group->fill($attributes);
		$group->save();
		return $group;
	}
779555
public function setAttributes(array $attributes = null)
    {
        ValidationUtility::ensureNullOrArrayOfType(
            '$attributes', $attributes, __NAMESPACE__ . '\Pair');

        $this->attributes = $attributes;

        return $this;
    }
540209
public function addAttribute(Attribute$attribute) : Attributes
	{
		$this->getItems();//max sure is array
		$this->attributes[$attribute->getName()] = $attribute;
		return $this;
	}