@param array $elements

@return \marvin255\serviform\interfaces\HasChildren
180
public function setElements(array $elements)
    {
        $this->elements = [];
        foreach ($elements as $name => $element) {
            $this->setElement($name, $element);
        }

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

        return $this->newNodeList(array_merge($this->toArray(), $elements));
    }
1338534
public function prependChild(Element $element)
	{
		$this->beforeInsert($element);
		
		array_unshift($this->children, $element);
		
		$this->afterInsert();
		
		return $this;
	}
1016855
protected function inline($elements) {
		if (1 < func_num_args()) {
			$elements = func_get_args();
		}
		return
			is_array($elements)
			? array_map([$this, __FUNCTION__], $elements)
			: $elements->setRenderer(Inline::s())
		;
	}
838807
public function setChildren($children)
    {
        $this->clearChildren();
        foreach ($children as $child) {
            $this->addChild($child);
        }

        return $this;
    }
1072279
private function removeElements( $elements ) {
		$list = $elements;
		if ( $elements instanceof \DOMNodeList ) {
			$list = [];
			foreach ( $elements as $element ) {
				$list[] = $element;
			}
		}
		/** @var $element \DOMElement */
		foreach ( $list as $element ) {
			if ( $element->parentNode ) {
				$element->parentNode->removeChild( $element );
			}
		}
		return $list;
	}
859147
public function addChildren(Collection $children)
    {
        foreach ($children as $child) {
                $this->addChild($child);
        }

        return $this;
    }
231817
protected function _findInChildren(array $element, $id, $withParents, array &$parents)
    {
        if ($element['id'] == $id) {
            return $element;
        }
        foreach ($element['children'] as $child) {
            if ($child['id'] == $id) {
                if ($withParents) {
                    $parents[] = $element;
                }
                return $child;
            }
            if (null !== ($found = $this->_findInChildren($child, $id, $withParents, $parents))) {
                if ($withParents) {
                    $parents[] = $element;
                }
                return $found;
            }
        }
    }
874219
public function addElement($element){

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

        $this->formElements = $elements;

        return $this;
    }
1086732
public function getChildren(array $columns = ['*'])
    {
        if ($this->hasChildrenRelation()) {
            $result = $this->getRelation($this->getChildrenRelationIndex());
        } else {
            $result = $this->children()->get($columns);
        }

        return $result;
    }
125861
public function addElements(array $elements): self
    {
        foreach ($elements as $element) {
            if ($element instanceof OpenGraphElement) {
                $this->elements[] = $element->toArray();
            }
        }

        return $this;
    }
224333
public function classes(array $classes) : Element
    {
        $this->classes = array_merge($this->classes, $classes);

        return $this;
    }
1357308
public static function removeElementsFromArray($elements, &$array)
    {
        if (!is_array($elements))
        {
            $elements = [$elements];
        }
        $length = count($array);
        for ($i = 0; $i < $length; $i++)
        {
            $exist = false;
            foreach ($elements as $element)
            {
                if ($array[$i] == $element)
                {
                    $exist = true;
                    break;
                }
            }
            if ($exist)
            {
                unset($array[$i]);
            }
        }
        $array = array_values($array);
    }
1100495
public function addAll(array $elements)
    {
        if (is_array($elements)) {
            foreach ($elements as $element) {
                $this->add($element);
            }
        }
    }
10108
protected function _hasAllowedChildren(array $children): bool
    {
        foreach ($children as $child) {
            if ($this->Auth->urlAllowed($child['url'])) {
                return true;
            }
        }

        return false;
    }
529217
public function setChildren($children)
    {
        $children = (array) $children;

        foreach ($children as $argument) {
            $this->addCommand($argument);
        }

        return $this;
    }
98369
public function addChildren($children, $mapper = null)
    {
        if (is_null($children)) {
            return $this;
        }

        $children = $this->parseChildren($children, $mapper);

        $element = clone $this;

        $element->children = $element->children->merge($children);

        return $element;
    }