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;
|
$this->modelKey = $controller->modelKey;
|
||||||
|
|
||||||
if (!is_object($this->controller->{$this->modelClass})) {
|
if (!is_object($this->controller->{$this->modelClass})) {
|
||||||
return $this->cakeError('missingModel', array(array(
|
throw new MissingModelException($this->modelClass);
|
||||||
'className' => $this->modelClass, 'webroot' => '', 'base' => $controller->base
|
|
||||||
)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->ScaffoldModel =& $this->controller->{$this->modelClass};
|
$this->ScaffoldModel =& $this->controller->{$this->modelClass};
|
||||||
|
@ -485,17 +483,11 @@ class Scaffold extends Object {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return $this->cakeError('missingAction', array(array(
|
$message = sprintf('%s::%s()', $this->controller->name . "Controller", $this->action);
|
||||||
'className' => $this->controller->name . "Controller",
|
throw new MissingActionException($message);
|
||||||
'base' => $this->controller->base,
|
|
||||||
'action' => $this->action,
|
|
||||||
'webroot' => $this->controller->webroot
|
|
||||||
)));
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return $this->cakeError('missingDatabase', array(array(
|
throw new MissingDatabaseException($this->ScaffoldModel->useDbConfig);
|
||||||
'webroot' => $this->controller->webroot
|
|
||||||
)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -605,6 +597,6 @@ class ScaffoldView extends ThemeView {
|
||||||
return LIBS . 'view' . DS . 'errors' . DS . 'scaffold_error.ctp';
|
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