Add children to tag

@param array $children

@throws Exception\RuntimeException
@return  \SxCore\Html\HtmlElement
507949
public function addChildren(array $children)
    {
        if ($this->isVoid) {
            throw new Exception\RuntimeException(
                'Void elements can\'t have child elements.'
            );
        }

        foreach ($children as $child) {
            $this->addChild($child);
        }

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

        $this->children_attributes = $attributes;

        return $this;
    }
69061
public function addPages($pages)
        {
            if ($pages instanceof Container) {
                $pages = iterator_to_array($pages);
            }

            if (!is_array($pages)) {
                throw new Exception('Invalid argument: $pages must be an array, an instance of Container');
            }

            foreach ($pages as $page) {
                $this->addPage($page);
            }

            return $this;
        }
774860
public function add($nodes) {
    if ($nodes instanceof Node) {
      $this->nodes[] = $nodes;
    }
    elseif ($nodes instanceof NodeCollection) {
      $this->nodes = array_merge($this->nodes, $nodes->nodes);
    }
    elseif (is_array($nodes)) {
      $this->nodes = array_merge($this->nodes, $nodes);
    }
    else {
      throw new \InvalidArgumentException();
    }
    $this->nodes = static::sortUnique($this->nodes);
    return $this;
  }
510079
public function addAll(array $elements) : Set
    {
        $this->elements = self::sanitize(array_merge($this->elements, $elements));

        return $this;
    }
67833
private void addChildElements() {
		for (Node node : nodes) {
			Collection<? extends Node> childNodes = helper.getChildNodes(node);
			for (Node child : childNodes)
				if (matchTag(child))
					result.add(child);
		}
	}
795506
public function addChildren($child) : void
    {
        Assert::isInstanceOfAny($child, [Chunk::class, Attribute::class]);
        $this->children[] = $child;
    }
1307306
public function setChildNodes(array $childNodes)
    {
        /** @var $rootNode RootNode */
        $rootNode = $this->objectManager->get(\TYPO3\Fluid\Core\Parser\SyntaxTree\RootNode::class);
        foreach ($childNodes as $childNode) {
            $rootNode->addChildNode($childNode);
        }
        $this->widgetContext->setViewHelperChildNodes($rootNode, $this->renderingContext);
    }
929906
private function _appendChildren(array &$children, $name, array $_children)
  {
    foreach ($_children as $key => $value) {
      $children[$name . "/" . $key] = $value;
    }
  }
461606
public function addContentItems($items = [])
    {
        // Loop on each item.
        collect($items)->each(function ($item) {
            // Add each content to the Container.
            $this->addSingleContentItem($item);
        });

        // Return object.
        return $this;
    }
975678
public function set(array $tags)
    {
        if (!empty($tags)) {
            foreach ($tags as $_tag) {
                $this->add($_tag);
            }
        }
        return $this;
    }
599138
public function addChild($child)
    {
        $class = $this->getShortName($child);

        // Only add child if it's an known element.
        if (array_key_exists($class, $this->elements)) {
            // If we can expect more, add it to an array.
            //if (substr($this->elements[$class], -6) == '_MULTI') {
            if (in_array($this->elements[$class], [self::REQUIRED_MULTI, self::OPTIONAL_MULTI])) {
                $this->{$class}[] = $child;
            } else {
                $this->{$class} = $child;
            }
        } else {
            die($this->getShortName(get_called_class()) .": {$class} is not allowed as a child element.");
        }
    }
27762
public function recursiveTidy($children)
    {

        foreach ($children as $page) {
            $write = false;

            // This is so something (events for example) can be purged.

            if ($this->purge && is_a($page, $this->purge, true)) {
                $page->delete();
                $this->purged++;
                continue;
            }

            // The most common issue is that the site ID doesn't match.

            if ($page->SiteID != $this->siteID) {

                // Update it to match.

                $page->SiteID = $this->siteID;
                $write        = true;
            }

            // The next issue is that duplicated URL segments have numbers appended (`URL-segment-2` for example).

            if (preg_match('%-[0-9]$%', $page->URLSegment)) {

                // When a page title ends with a number, the URL should match this.

                $last = substr($page->Title, -1);
                if (is_numeric($last)) {

                    // Determine whether this actually needs fixing.

                    if ($last !== substr($page->URLSegment, -1)) {

                        // Update it to match.

                        $page->URLSegment = $page->Title;
                        $write            = true;
                    }
                }

                // The number appended shouldn't exist.
                else {

                    // Determine whether this is considered unique (otherwise it can't be updated).

                    $to = substr($page->URLSegment, 0, -2);
                    if (!SiteTree::get()->filter(array(
                            'ParentID' => $page->ParentID,
                            'URLSegment' => $to
                        ))->exists()) {

                        // This isn't unique, so update it.

                        $page->URLSegment = $to;
                        $write            = true;
                    }
                }
            }

            // Determine whether this page needs a write.

            if ($write) {
                $page->write();
                $this->count++;
            }

            // Where necessary, continue further down.

            $this->recursiveTidy($page->AllChildren());
        }
    }
852004
public function addBody($items)
    {
        if (! is_array($items)) {
            $items = func_get_args();
        }

        $class = $this->getElements()->last();
        if (is_object($class) && get_class($class) === Body::class) {
            $this->addElement(new Html('<hr />'));
        }

        $this->addElement(new Body($items));

        return $this;
    }
893687
public function addChildren(PageInterface $children)
    {
        $this->children[] = $children;

        $children->setParent($this);

        return $this;
    }
503931
public function addAll($elements)
    {
        if ($elements instanceof CollectionInterface) {
            $elements = $elements->toArray();
        } else {
            $elements = array_values($elements);
        }
        $this->elements = array_merge($this->elements, $elements);
        return $this;
    }
838807
public function setChildren($children)
    {
        $this->clearChildren();
        foreach ($children as $child) {
            $this->addChild($child);
        }

        return $this;
    }