public function setChildren (array $components = [])
  {
    self::removeAll ($components);
    $this->children = $components;
    $this->attach ($components);
  }
public function setChildren (array $components = [])
  {
    self::removeAll ($components);
    $this->children = $components;
    $this->attach ($components);
  }
public function setChildren ( array $ components = [ ] ) { self :: removeAll ( $ components ) ; $ this -> children = $ components ; $ this -> attach ( $ components ) ; }
Replaces the current children with the supplied ones.

> <p>**Warning:** the previou children (if any) will be detached and removed from their respective parents.

@param array $components
Replaces the current children with the supplied ones .