mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Replacing cakeError with exceptions in Scaffold.
This commit is contained in:
parent
e600f86abd
commit
c4cb629d80
1 changed files with 5 additions and 13 deletions
|
@ -169,9 +169,7 @@ class Scaffold extends Object {
|
|||
$this->modelKey = $controller->modelKey;
|
||||
|
||||
if (!is_object($this->controller->{$this->modelClass})) {
|
||||
return $this->cakeError('missingModel', array(array(
|
||||
'className' => $this->modelClass, 'webroot' => '', 'base' => $controller->base
|
||||
)));
|
||||
throw new MissingModelException($this->modelClass);
|
||||
}
|
||||
|
||||
$this->ScaffoldModel =& $this->controller->{$this->modelClass};
|
||||
|
@ -485,17 +483,11 @@ class Scaffold extends Object {
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
return $this->cakeError('missingAction', array(array(
|
||||
'className' => $this->controller->name . "Controller",
|
||||
'base' => $this->controller->base,
|
||||
'action' => $this->action,
|
||||
'webroot' => $this->controller->webroot
|
||||
)));
|
||||
$message = sprintf('%s::%s()', $this->controller->name . "Controller", $this->action);
|
||||
throw new MissingActionException($message);
|
||||
}
|
||||
} else {
|
||||
return $this->cakeError('missingDatabase', array(array(
|
||||
'webroot' => $this->controller->webroot
|
||||
)));
|
||||
throw new MissingDatabaseException($this->ScaffoldModel->useDbConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -605,6 +597,6 @@ class ScaffoldView extends ThemeView {
|
|||
return LIBS . 'view' . DS . 'errors' . DS . 'scaffold_error.ctp';
|
||||
}
|
||||
|
||||
return $this->_missingView($paths[0] . $name . $this->ext, 'missingView');
|
||||
throw new MissingViewException($paths[0] . $name . $this->ext);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue