/** * Generate the corresponding javascript code for a call to any method * * @return string */ public function __call($sMethod, $aArguments) { // Check if the method exists in the controller, and is public /*if(!$this->reflectionClass->hasMethod($sMethod)) { // Todo: throw an exception } if(!$this->reflectionClass->getMethod($sMethod)->isPublic()) { // Todo: throw an exception }*/ // Prepend the controller class name to the method name $sMethod = $this->controller->getJaxonClassName() . '.' . $sMethod; // Make the request return call_user_func_array('\\Jaxon\\Request\\Factory::call', array_merge(array($sMethod), $aArguments)); }
/** * Generate the corresponding javascript code for a call to any method * * @return string */ public function __call($sMethod, $aArguments) { // Check if the method exists in the controller, and is public /*if(!$this->reflectionClass->hasMethod($sMethod)) { // Todo: throw an exception } if(!$this->reflectionClass->getMethod($sMethod)->isPublic()) { // Todo: throw an exception }*/ // Prepend the controller class name to the method name $sMethod = $this->controller->getJaxonClassName() . '.' . $sMethod; // Add the paginator options to the method arguments $aArguments = array_merge(array($this->nItemsTotal, $this->nItemsPerPage, $this->nCurrentPage, $sMethod), $aArguments); // Make the request return call_user_func_array('\\Jaxon\\Request\\Factory::paginate', $aArguments); }