Back to NodeTrait class

Method removeChild

public void
removeChild
(\Joomla\CMS\Tree\NodeInterface $child)
Remove a specific child
Parameters
  • \Joomla\CMS\Tree\NodeInterface $child Child to remove
Returns
  • void
Since
  • 4.0.0
Class: NodeTrait
Project: Joomla

Method removeChild - Source code

/**
 * Remove a specific child
 *
 * @param   NodeInterface  $child  Child to remove
 *
 * @return  void
 *
 * @since   4.0.0
 */
public function removeChild(NodeInterface $child)
{
    $key = array_search($child, $this->_children);
    unset($this->_children[$key]);
}