protected function ensureRootstays(AbstractCategory $category) { if ($category->getParent() === null) { throw new RootMayNotBeDeletedException(); } }