public function removeGroup($name)
{
if (is_string($name) && isset($this->groups[$name])) {
$group = $this->groups[$name];
} elseif ($name instanceof ControlGroup && in_array($name, $this->groups, TRUE)) {
$group = $name;
$name = array_search($group, $this->groups, TRUE);
} else {
throw new Nette\InvalidArgumentException("Group not found in form '{$this->name}'");
}
foreach ($group->getControls() as $control) {
$control->getParent()->removeComponent($control);
}
unset($this->groups[$name]);
}