From 35ff9d45dc2c4b2af9132100374938a728ebf5ef Mon Sep 17 00:00:00 2001 From: phpnut Date: Thu, 23 Nov 2006 21:39:09 +0000 Subject: [PATCH] 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 --- cake/basics.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cake/basics.php b/cake/basics.php index ac136244f..0c74c01a6 100644 --- a/cake/basics.php +++ b/cake/basics.php @@ -138,7 +138,7 @@ /** * Loads a model by CamelCase name. */ - function loadModel($name) { + function loadModel($name = null) { if(!class_exists('Model')){ require LIBS . 'model' . DS . 'model.php'; } @@ -151,7 +151,7 @@ Overloadable::overload('AppModel'); } - if (!class_exists($name)) { + if (!is_null($name) && !class_exists($name)) { $className = $name; $name = Inflector::underscore($name); $paths = Configure::getInstance();