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:
phpnut 2006-11-23 21:39:09 +00:00
parent ca5753bc39
commit 35ff9d45dc

View file

@ -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();