correct namespaces

This commit is contained in:
coderkun 2013-08-27 14:24:31 +02:00
parent b392eb9188
commit 7348ca080c
3 changed files with 17 additions and 13 deletions

View file

@ -116,17 +116,20 @@
try {
return $this->_run($request, $response);
}
catch(ParamsNotValidException $e) {
$this->error($e, WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN);
catch(\nre\exceptions\AccessDeniedException $e) {
$this->error($e, \nre\core\WebUtils::HTTP_FORBIDDEN, self::STAGE_RUN);
}
catch(IdNotFoundException $e) {
$this->error($e, WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN);
catch(\nre\exceptions\ParamsNotValidException $e) {
$this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN);
}
catch(DatamodelException $e) {
$this->error($e, WebUtils::HTTP_SERVICE_UNAVAILABLE, self::STAGE_RUN);
catch(\nre\exceptions\IdNotFoundException $e) {
$this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN);
}
catch(ActionNotFoundException $e) {
$this->error($e, WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN);
catch(\nre\exceptions\DatamodelException $e) {
$this->error($e, \nre\core\WebUtils::HTTP_SERVICE_UNAVAILABLE, self::STAGE_RUN);
}
catch(\nre\exceptions\ActionNotFoundException $e) {
$this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND, self::STAGE_RUN);
}
}
@ -173,8 +176,8 @@
func_get_args()
);
}
catch(DatamodelException $e) {
throw new FatalDatamodelException($e->getDatamodelMessage(), $e->getDatamodelErrorNumber());
catch(\nre\exceptions\DatamodelException $e) {
throw new \nre\exceptions\FatalDatamodelException($e->getDatamodelMessage(), $e->getDatamodelErrorNumber());
}
}

View file

@ -60,7 +60,7 @@
$this->errorService($e);
}
catch(\nre\exceptions\ActionNotFoundException $e) {
$this->error($e, WebUtils::HTTP_NOT_FOUND);
$this->error($e, \nre\core\WebUtils::HTTP_NOT_FOUND);
}
catch(\nre\exceptions\FatalDatamodelException $e) {
$this->errorService($e);

View file

@ -74,7 +74,7 @@
*/
private static function getClassName($modelName)
{
$className = \nre\core\ClassLoader::concatClassNames($modelName, \nre\core\ClassLoader::stripNamespace(get_class()));
$className = ClassLoader::concatClassNames($modelName, ClassLoader::stripNamespace(get_class()));
return \nre\configs\AppConfig::$app['namespace']."models\\$className";
@ -131,7 +131,8 @@
Model::load($model);
// Construct Model
$this->$model = Model::factory($model);
$modelName = ucfirst(strtolower($model));
$this->$modelName = Model::factory($model);
}
}