/** * @param Level $level * @param bool $forceUnload * * @return bool */ public function unloadLevel(Level $level, $forceUnload = false) { if ($level === $this->getDefaultLevel() and !$forceUnload) { throw new \InvalidStateException("The default level cannot be unloaded while running, please switch levels."); } if ($level->unload($forceUnload) === true) { unset($this->levels[$level->getId()]); return true; } return false; }
/** * @param Level $level * @param bool $forceUnload * * @return bool */ public function unloadLevel(Level $level, $forceUnload = false) { if ($level->unload($forceUnload) === true) { unset($this->levels[$level->getId()]); return true; } return false; }