/** * * "Removes" an item from the Children array, but by default not using PHP's * unset() function becuase this will cause PHP to reset its internal array * pointer and we need to maintain array state. Use the $force param to unset. * * @param int $childID * @param boolean $force Invoke PHP's unset() function on the selected item. * @return void */ public function removeChild($childID, $force = true) { if (isset($this->Children[$childID])) { if ($force === true) { unset($this->Children[$childID]); } else { $this->Children[$childID] = CacheableSiteTree::create(); // dummy } } }