Ejemplo n.º 1
0
 /**
  * 
  * @TODO This callback code should be ported to QuickBooks_Callbacks style calls
  * 
  * @param string $func_or_method
  * @param string $method
  * @param string $action
  * @param mixed $ID
  * @param string $err
  * @param string $qbxml
  * @param object $qbobject
  * @param resource $qbres
  * @return boolean
  */
 protected static function _callCallbacks($funcs_or_methods, $method, $action, $ID, &$err, $qbxml, $qbobject, $qbres)
 {
     foreach ($funcs_or_methods as $callback) {
         if (!$callback) {
             continue;
         }
         $return = QuickBooks_Callbacks::callAPICallback(null, null, $callback, $method, $action, $ID, $err, $qbxml, $qbobject, $qbres);
         /*
         else if (false !== strpos($func, '::') and 
         	true) // method_exists()) 	// is this safe to do?
         {
         	// Callback *static method*
         	
         	$tmp = explode('::', $func);
         	
         	$return = call_user_func(array( $tmp[0], $tmp[1] ), $method, $action, $ID, $err, $qbxml, $qbobject, $qbres);
         }
         else if (function_exists($func))
         {
         	// Callback *function* 
         	
         	$return = call_user_func($func, $method, $action, $ID, $err, $qbxml, $qbobject, $qbres);
         }
         else
         {
         	$err = 'Could not call function or method: ' . $func;
         	return false;
         }
         */
         if (!$return) {
             break;
         }
     }
     if ($err) {
         return false;
     }
     return true;
 }