From bcb31fc2323f8144679e48b096f3f0f7631a2d1f Mon Sep 17 00:00:00 2001 From: zYne Date: Fri, 17 Aug 2007 21:22:03 +0000 Subject: [PATCH] added template method call delegator --- lib/Doctrine/Record.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index bc6ca3895..caad0b344 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -1476,6 +1476,16 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count } return $this; } + public function __call($method, $args) + { + foreach ($this->_table->getTemplates as $template) { + if (method_exists($template, $method)) { + return call_user_func_array(array($template, $method), $args); + } + } + + throw new Doctrine_Record_Exception('Unknown method ' . $method); + } /** * used to delete node from tree - MUST BE USE TO DELETE RECORD IF TABLE ACTS AS TREE *