Commit 2f8c8398 authored by meus's avatar meus

removing class variable adding static function var

parent 72ae6ff8
...@@ -119,12 +119,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count ...@@ -119,12 +119,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
*/ */
private $_oid; private $_oid;
/**
* @var array $_methods array that contains methods that are already checked for
*/
protected $_methods;
/** /**
* constructor * constructor
* @param Doctrine_Table|null $table a Doctrine_Table object or null, * @param Doctrine_Table|null $table a Doctrine_Table object or null,
...@@ -1517,8 +1511,9 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count ...@@ -1517,8 +1511,9 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
*/ */
public function __call($method, $args) public function __call($method, $args)
{ {
if ( isset( $this->_methods[$method])) { static $methods = array();
$methodArray = $this->_methods[$method]; if ( isset( $methods[$method])) {
$methodArray = $methods[$method];
$template = $methodArray["template"]; $template = $methodArray["template"];
$template->setInvoker($this); $template->setInvoker($this);
return call_user_func_array( array( $template, $method ), $methodArray["args"]); return call_user_func_array( array( $template, $method ), $methodArray["args"]);
...@@ -1526,7 +1521,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count ...@@ -1526,7 +1521,7 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
foreach ($this->_table->getTemplates() as $template) { foreach ($this->_table->getTemplates() as $template) {
if (method_exists($template, $method)) { if (method_exists($template, $method)) {
$template->setInvoker($this); $template->setInvoker($this);
$this->_methods[$method] = array("template" => $template, "args" => $args); $methods[$method] = array("template" => $template, "args" => $args);
return call_user_func_array(array($template, $method), $args); return call_user_func_array(array($template, $method), $args);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment