mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Allowing loadModel to accept null as a param.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3944 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
ca5753bc39
commit
35ff9d45dc
1 changed files with 2 additions and 2 deletions
|
@ -138,7 +138,7 @@
|
||||||
/**
|
/**
|
||||||
* Loads a model by CamelCase name.
|
* Loads a model by CamelCase name.
|
||||||
*/
|
*/
|
||||||
function loadModel($name) {
|
function loadModel($name = null) {
|
||||||
if(!class_exists('Model')){
|
if(!class_exists('Model')){
|
||||||
require LIBS . 'model' . DS . 'model.php';
|
require LIBS . 'model' . DS . 'model.php';
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,7 @@
|
||||||
Overloadable::overload('AppModel');
|
Overloadable::overload('AppModel');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists($name)) {
|
if (!is_null($name) && !class_exists($name)) {
|
||||||
$className = $name;
|
$className = $name;
|
||||||
$name = Inflector::underscore($name);
|
$name = Inflector::underscore($name);
|
||||||
$paths = Configure::getInstance();
|
$paths = Configure::getInstance();
|
||||||
|
|
Loading…
Add table
Reference in a new issue