| @@ 64-73 (lines=10) @@ | ||
| 61 | * scans the child of EEME_Base for functions starting with ext_, and magically makes them functions on the |
|
| 62 | * model extended. (Internally uses filters, and the __call magic method) |
|
| 63 | */ |
|
| 64 | protected function _register_extending_methods(){ |
|
| 65 | $all_methods = get_class_methods(get_class($this)); |
|
| 66 | foreach($all_methods as $method_name){ |
|
| 67 | if(strpos($method_name, self::extending_method_prefix) === 0){ |
|
| 68 | $method_name_on_model = str_replace(self::extending_method_prefix, '', $method_name); |
|
| 69 | $callback_name = "FHEE__EE_{$this->_model_name_extended}__$method_name_on_model"; |
|
| 70 | add_filter($callback_name,array($this,self::dynamic_callback_method_prefix.$method_name_on_model),10,10); |
|
| 71 | } |
|
| 72 | } |
|
| 73 | } |
|
| 74 | /** |
|
| 75 | * scans the child of EEME_Base for functions starting with ext_, and magically REMOVES them as functions on the |
|
| 76 | * model extended. (Internally uses filters, and the __call magic method) |
|
| @@ 78-87 (lines=10) @@ | ||
| 75 | * scans the child of EEME_Base for functions starting with ext_, and magically REMOVES them as functions on the |
|
| 76 | * model extended. (Internally uses filters, and the __call magic method) |
|
| 77 | */ |
|
| 78 | public function deregister(){ |
|
| 79 | $all_methods = get_class_methods(get_class($this)); |
|
| 80 | foreach($all_methods as $method_name){ |
|
| 81 | if(strpos($method_name, self::extending_method_prefix) === 0){ |
|
| 82 | $method_name_on_model = str_replace(self::extending_method_prefix, '', $method_name); |
|
| 83 | $callback_name = "FHEE__EE_{$this->_model_name_extended}__$method_name_on_model"; |
|
| 84 | remove_filter($callback_name,array($this,self::dynamic_callback_method_prefix.$method_name_on_model),10); |
|
| 85 | } |
|
| 86 | } |
|
| 87 | } |
|
| 88 | ||
| 89 | ||
| 90 | public function __call($callback_method_name,$args){ |
|
| @@ 144-153 (lines=10) @@ | ||
| 141 | * scans the child of EEME_Base for functions starting with ext_, and magically makes them functions on the |
|
| 142 | * model extended. (Internally uses filters, and the __call magic method) |
|
| 143 | */ |
|
| 144 | protected function _register_extending_methods(){ |
|
| 145 | $all_methods = get_class_methods(get_class($this)); |
|
| 146 | foreach($all_methods as $method_name){ |
|
| 147 | if(strpos($method_name, self::extending_method_prefix) === 0){ |
|
| 148 | $method_name_on_model = str_replace(self::extending_method_prefix, '', $method_name); |
|
| 149 | $callback_name = "FHEE__EEM_{$this->_model_name_extended}__$method_name_on_model"; |
|
| 150 | add_filter($callback_name,array($this,self::dynamic_callback_method_prefix.$method_name_on_model),10,10); |
|
| 151 | } |
|
| 152 | } |
|
| 153 | } |
|
| 154 | ||
| 155 | /** |
|
| 156 | * scans the child of EEME_Base for functions starting with ext_, and magically REMOVES them as functions on the |
|