Exemple #1
0
 /**
  * 
  * 
  * @param string $hook
  * @param string $requestID
  * @param string $user
  * @param string $ticket
  * @param string $err
  * @param array $hook_data
  * @return boolean
  */
 protected function _callHooks($hook, $requestID, $user, $ticket, &$err, $hook_data)
 {
     $err = '';
     return QuickBooks_Callbacks::callHook($this->_driver, $this->_hooks, $hook, $requestID, $user, $ticket, $err, $hook_data, $this->_callback_config);
 }
 /**
  * Call a user-defined hook 
  * 
  * @param string $ticket
  * @param string $hook
  * @param string $requestID
  * @param string $action
  * @param mixed $ident
  * @param mixed $extra
  * @param string $err
  * @param string $xml
  * @param array $qb_identifiers
  * @param array $hook_data
  * @return boolean
  */
 protected function _callHook($ticket, $hook, $requestID, $action, $ident, $extra, &$err, $xml = '', $qb_identifiers = array(), $hook_data = array())
 {
     $user = '';
     if ($ticket) {
         $user = $this->_driver->authResolve($ticket);
     }
     // Call the hook
     $ret = QuickBooks_Callbacks::callHook($this->_driver, $this->_hooks, $hook, $requestID, $user, $ticket, $err, $hook_data, $this->_callback_config, __FILE__, __LINE__);
     // If the hook reported an error, log the error
     if ($err) {
         $errerr = '';
         $this->_handleError($ticket, QUICKBOOKS_ERROR_HOOK, $err, $requestID, $action, $ident, $extra, $errerr, $xml, $qb_identifiers);
     }
     return true;
 }
 /**
  * 
  * 
  * @todo Implement error handling routines
  *
  * @param array $hooks
  * @param string $hook
  * @param string $requestID
  * @param string $user
  * @param string $err
  * @param array $hook_data
  * @param array $callback_config
  * @return boolean
  */
 protected static function _callHooks(&$hooks, $hook, $requestID, $user, &$err, $hook_data, $callback_config = array())
 {
     $Driver = QuickBooks_Driver_Singleton::getInstance();
     return QuickBooks_Callbacks::callHook($Driver, $hooks, $hook, $requestID, $user, null, $err, $hook_data, $callback_config, __FILE__, __LINE__);
 }
Exemple #4
0
 /**
  * Call any user-defined hooks hooked into a particular type of event
  * 
  * Hooks will be executed in the order they were added in. If any hook 
  * returns FALSE, then execution for that type of hook will be stopped and 
  * no other hooks will run. Errors reported via the $err parameter will be 
  * logged using the driver logging mechanism. 
  * 
  * @param string $hook			The type of hook we're to execute
  * @param string $ticket		The Web Connector ticket 
  * @param string $err			Any error messages that should be reported 
  * @param array $hook_data		An array of hook data
  * @return boolean
  */
 protected final function _callHook($hook, $ticket, &$err, $hook_data)
 {
     $user = '';
     if ($ticket) {
         $user = (string) $this->_authResolve($ticket);
     }
     QuickBooks_Callbacks::callHook($this, $this->_hooks, $hook, null, $user, $ticket, $err, $hook_data, null, __FILE__, __LINE__);
     /*
     if (isset($this->_hooks[$hook]))
     {
     	foreach ($this->_hooks[$hook] as $func)		// Call each hook (if a hook return false, stop calling hooks)
     	{
     		$ret = $func($ticket, $user, $err, $hook_data);
     		
     		if ($ret == false)
     		{
     			return false;
     		}
     	}
     }
     */
     if ($err) {
         // Log errors reporting by hooks
         $this->errorLog($ticket, QUICKBOOKS_ERROR_HOOK, $err);
     }
     return true;
 }
Exemple #5
0
 /**
  * Call any user-defined hooks hooked into a particular type of event
  * 
  * Hooks will be executed in the order they were added in. If any hook 
  * returns FALSE, then execution for that type of hook will be stopped and 
  * no other hooks will run. Errors reported via the $err parameter will be 
  * logged using the driver logging mechanism. 
  * 
  * @param string $hook			The type of hook we're to execute
  * @param string $ticket		The Web Connector ticket 
  * @param string $err			Any error messages that should be reported 
  * @param array $hook_data		An array of hook data
  * @return boolean
  */
 protected final function _callHook($hook, $ticket, &$err, $hook_data)
 {
     $user = '';
     if ($ticket) {
         $user = (string) $this->_authResolve($ticket);
     }
     // Call the hook
     QuickBooks_Callbacks::callHook($this, $this->_hooks, $hook, null, $user, $ticket, $err, $hook_data, null, __FILE__, __LINE__);
     if ($err) {
         // Log errors reporting by hooks
         $this->errorLog($ticket, QUICKBOOKS_ERROR_HOOK, $err);
     }
     return true;
 }
 protected function _callHooks(&$hooks, $hook, $requestID, $user, &$err, $hook_data, $callback_config = array())
 {
     // @TODO Will this work with non-SQL drivers?
     $Driver = $this->_driver;
     return QuickBooks_Callbacks::callHook($Driver, $hooks, $hook, $requestID, $user, null, $err, $hook_data, $callback_config, __FILE__, __LINE__);
 }