/** * invoke * * @access public * @param string $method * @return void */ public function invoke($method) { $interceptor = $this->_manager->fetch(); if (empty($interceptor)) { foreach ($this->_data as $key => $val) { if (empty($this->_controller->{$key})) { $this->_controller->{$key} = $val; } } $result = $this->invokeMethod($method); if (NULL === $result) { $result = 'blank'; } $resultName = is_array($result) ? array_shift($result) : $result; $params = is_array($result) ? $result : array(); $this->setResult($resultName, $params); $data = get_object_vars($this->_controller); $this->_data = array_merge($this->_data, $data); } else { $interceptor->intercept($this); } }
/** * @param InterceptorManager $interceptorManager * @param $name * @return InterceptorManager */ protected function onPushInterceptor(InterceptorManager $interceptorManager, $name) { $interceptorManager->push($name); }