From a4ca03ed69ce5429f9b1b09721ee464136e565c5 Mon Sep 17 00:00:00 2001 From: phpnut Date: Tue, 26 Dec 2006 16:17:37 +0000 Subject: [PATCH] Fixing magic method names git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4211 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/model.php | 4 ++-- cake/libs/overloadable_php4.php | 16 ++++++++-------- cake/libs/overloadable_php5.php | 12 ++++++------ cake/libs/view/helper.php | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cake/libs/model/model.php b/cake/libs/model/model.php index c27c003e2..2f578a764 100644 --- a/cake/libs/model/model.php +++ b/cake/libs/model/model.php @@ -443,7 +443,7 @@ class Model extends Overloadable { * @return unknown * @access protected */ - function __call__($method, $params) { + function call__($method, $params) { $db =& ConnectionManager::getDataSource($this->useDbConfig); $methods = array_map('strtolower', array_keys($this->__behaviorMethods)); @@ -1691,7 +1691,7 @@ class Model extends Overloadable { } $result = $this->findAll($conditions, $fields, $order, $limit); $this->recursive = $recursive; - + if(!$result) { return false; } diff --git a/cake/libs/overloadable_php4.php b/cake/libs/overloadable_php4.php index dc32c4915..8c7094dd1 100644 --- a/cake/libs/overloadable_php4.php +++ b/cake/libs/overloadable_php4.php @@ -59,10 +59,10 @@ class Overloadable extends Object { } function __call($method, $params, &$return) { - if(!method_exists($this, '__call__')) { - trigger_error(sprintf(__('Magic method handler __call__ not defined in %s', true), get_class($this)), E_USER_ERROR); + if(!method_exists($this, 'call__')) { + trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); } - $return = $this->__call__($method, $params); + $return = $this->call__($method, $params); return true; } } @@ -92,20 +92,20 @@ class Overloadable2 extends Object { } function __call($method, $params, &$return) { - if(!method_exists($this, '__call__')) { - trigger_error(sprintf(__('Magic method handler __call__ not defined in %s', true), get_class($this)), E_USER_ERROR); + if(!method_exists($this, 'call__')) { + trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); } - $return = $this->__call__($method, $params); + $return = $this->call__($method, $params); return true; } function __get($name, &$value) { - $value = $this->__get__($name); + $value = $this->get__($name); return true; } function __set($name, $value) { - $this->__set__($name, $value); + $this->set__($name, $value); return true; } } diff --git a/cake/libs/overloadable_php5.php b/cake/libs/overloadable_php5.php index 01b7b86e8..958e8b949 100644 --- a/cake/libs/overloadable_php5.php +++ b/cake/libs/overloadable_php5.php @@ -40,10 +40,10 @@ class Overloadable extends Object { function overload() { } function __call($method, $params) { - if(!method_exists($this, '__call__')) { - trigger_error(sprintf(__('Magic method handler __call__ not defined in %s', true), get_class($this)), E_USER_ERROR); + if(!method_exists($this, 'call__')) { + trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); } - return $this->__call__($method, $params); + return $this->call__($method, $params); } } @@ -52,10 +52,10 @@ class Overloadable2 extends Object { function overload() { } function __call($method, $params) { - if(!method_exists($this, '__call__')) { - trigger_error(sprintf(__('Magic method handler __call__ not defined in %s', true), get_class($this)), E_USER_ERROR); + if(!method_exists($this, 'call__')) { + trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); } - return $this->__call__($method, $params); + return $this->call__($method, $params); } function __get($name) { diff --git a/cake/libs/view/helper.php b/cake/libs/view/helper.php index b62ce8a78..4188a9351 100644 --- a/cake/libs/view/helper.php +++ b/cake/libs/view/helper.php @@ -130,7 +130,7 @@ class Helper extends Overloadable { */ function get__($name) {} function set__($name, $value) {} - function __call__($method, $params) { + function call__($method, $params) { trigger_error(sprintf(__('Method %1$s::%2$s does not exist', true), get_class($this), $method), E_USER_ERROR); }