_registeredCallbacks)) { $this->_registeredCallbacks[$endPoint] = array($func); } else { $this->_registeredCallbacks[$endPoint][] = $func; } } public function executeCallbacks() { $endpoint = func_get_arg(0); if (!array_key_exists($endpoint, $this->_registeredCallbacks)) { return false; } if (count(func_num_args()>1)) { $args = array_slice(func_get_args(), 1); } else { $args = array(); } foreach ($this->_registeredCallbacks[$endpoint] as $callback) { call_user_func_array($callback, $args); } return true; } }