public function setChildren($children, $mapper = null)
    {
        $element = clone $this;

        $element->children = new Collection();

        return $element->addChildren($children, $mapper);
    }
public function setChildren($children, $mapper = null)
    {
        $element = clone $this;

        $element->children = new Collection();

        return $element->addChildren($children, $mapper);
    }
public function setChildren ( $ children , $ mapper = null ) { $ element = clone $ this ; $ element -> children = new Collection ( ) ; return $ element -> addChildren ( $ children , $ mapper ) ; }
Replace all children with an array of elements.

@param \Spatie\Html\HtmlElement[] $children
@param callable|null $mapper

@return static
Replace all children with an array of elements .