@param array $elements

@return $this
348664
public function setElements(array $elements)
    {
        foreach ($elements as $label => $tab) {
            if ($tab instanceof TabInterface) {
                $this->addElement($tab);
            } else {
                $this->appendTab($tab, $label);
            }
        }

        return $this;
    }
437721
public function addElement(Element $element)
    {
        if (!in_array($element, $this->elements, true)) {
            array_push($this->elements, $element);
        }
        return $this;
    }
172720
public function addAll(array $items) : Set
    {
        $values = $this->_pushAll($items);
        $this->setValues($values);
        return $this;
    }
221594
public function setItems(array $items)
    {
        $this->content = new HtmlElements();

        foreach ($items as $item) {
            $this->addItem($item);
        }

        return $this;
    }
1256519
public function setExtensions(array $extensions)
    {
        $this->extensions = [];
        foreach ($extensions as $extension) {
            $this->addExtension($extension);
        }

        return $this;
    }
155637
public function addElement(OrderElement $elements)
    {
        $this->elements[] = $elements;
        $elements->setOrder($this);

        return $this;
    }
193564
public function setSelectionItems(array $items)
    {
        $this->selectionItems = $items;

        $this->model->selectionItems = $this->getCurrentlyAvailableSelectionItems();

        return $this;
    }
891717
public function addAll(array $elements)
    {
        if (is_array($elements)) {
            foreach ($elements as $element) {
                $this->_items[] = $element;
            }
            $this->_iterator = null;
        } else {
            throw new CollectionException('Given array can not added to collection, because it is no array.', E_NOTICE);
        }
    }
949215
public function push(...$elements): self
    {
        foreach ($elements as $element) {
            $this->validate($element);

            $this->elements[] = $element;
        }

        return $this;
    }
1142261
public function setChannelElementsFromArray(array $elementArray)
    {
        foreach ($elementArray as $elementName => $content) {
            $this->setChannelElement($elementName, $content);
        }

        return $this;
    }
50722
public function append($elements)
    {
        if (!empty($elements)) {
            $elements = is_array($elements) ? $elements : [$elements];

            foreach ($elements as $element) {
                if ($element instanceof Image || $element instanceof Text) {
                    $this->elementList[] = $element;
                }
            }
        }

        return $this;
    }
774206
public function setButtons(array $buttons): self
    {
        $this->isValidArray($buttons, 1);
        $this->isValidButtons($buttons, $this->getAllowedButtonsType());

        $this->buttons = $buttons;

        return $this;
    }
922414
public function build(array $elements)
	{
		$parsedElements = $this->parse($elements); 
		$result = $this->group($parsedElements);

        return $result;
	}
530657
public static function removeElementFromArray($elements, $array)
    {
        if (is_array($elements) && is_array($array))
        {
            foreach ($elements as $element)
            {
                if (in_array($element, $array))
                {
                    $key = array_search($element, $array);
                    unset($array[$key]);
                }
            }
        }
        return $array;
    }
1275615
public function setFields(array $fields)
    {
        foreach ($fields as $key => $field) {
            $this->setField($key, $field);
        }

        return $this;
    }
799893
public function set(string $key, $element): self
    {
        $this->validate($element);

        $this->elements[$key] = $element;

        foreach ($this->indexes as $index) {
            $index->add($key, $element);
        }

        return $this;
    }
560988
public function merge($elements = []): NodeList {
        if (!is_array($elements)) {
            $elements = $elements->toArray();
        }

        return $this->newNodeList(array_merge($this->toArray(), $elements));
    }