/** * Constructs a new exception * @param zibo\admin\model\Module $module The module which is being installed * @param string $message * @param int $code * @param Exception $previousException * @return null */ public function __construct(Module $module, $message = null, $code = 0, Exception $previousException = null) { $exceptionMessage = 'Could not install ' . $module->getName() . ' from namespace ' . $module->getNamespace(); if ($message) { $exceptionMessage .= ': ' . $message; } parent::__construct($module, $exceptionMessage, $code, $previousException); }
/** * Constructs a new exception * @param zibo\admin\model\Module $module The module which is still needed by other modules * @param Exception $previousException * @return null */ public function __construct(Module $module, Exception $previousException = null) { $usage = $module->getUsage(); $usageString = ''; foreach ($usage as $usedModule) { $usageString .= ($usageString ? ', ' : '') . $usedModule->getName() . ' from namespace ' . $usedModule->getNamespace(); } $message = 'Could not remove ' . $module->getName() . ' from namespace ' . $module->getNamespace() . ': still used by '; parent::__construct($module, $message . $usageString, 0, $previousException); }