当前位置: 首页>>代码示例>>PHP>>正文


PHP QuickBooks_Utilities::generateGUID方法代码示例

本文整理汇总了PHP中QuickBooks_Utilities::generateGUID方法的典型用法代码示例。如果您正苦于以下问题:PHP QuickBooks_Utilities::generateGUID方法的具体用法?PHP QuickBooks_Utilities::generateGUID怎么用?PHP QuickBooks_Utilities::generateGUID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QuickBooks_Utilities的用法示例。


在下文中一共展示了QuickBooks_Utilities::generateGUID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: input

 /**
  * Accept input from the data source and queue things up 
  * 
  * @param QuickBooks_Driver $Driver
  * @return boolean
  */
 public function input($Driver)
 {
     if ($this->_mode != QUICKBOOKS_TRANSPORT_MODE_INPUT) {
         return false;
     }
     // Clean up magic quotes junk
     $this->_compat();
     $defaults = array('method' => QUICKBOOKS_TRANSPORT_METHOD_ENQUEUE, 'action' => $this->_action, 'ident' => null, 'replace' => true, 'priority' => 0, 'extra' => null, 'qbxml' => null, 'id' => null);
     $data = array_merge($defaults, $_POST);
     if (empty($data['id'])) {
         $data['id'] = QuickBooks_Utilities::generateGUID();
     }
     $data['extra'] = array('__extra' => $data['extra'], '__id' => $data['id'], '__method' => $data['method'], '__replace' => $data['replace'], '__priority' => $data['priority']);
     // They must pass *at least* a valid method *and* either an action, or a qbXML request
     $errno = QUICKBOOKS_TRANSPORT_ERROR_OK;
     $errmsg = null;
     if (!$data['action'] and !$data['qbxml']) {
         $errno = QUICKBOOKS_TRANSPORT_ERROR_MISSING;
         $errmsg = 'You must HTTP POST at least either an "action" parameter or a "qbxml" parameter.';
     } else {
         if (!is_numeric($data['priority'])) {
             $errno = QUICKBOOKS_TRANSPORT_ERROR_VALIDATE;
             $errmsg = 'The value "' . $data['priority'] . '" is invalid for the priority field.';
         }
     }
     if (!$errno) {
         $ok = false;
         switch ($data['method']) {
             case QUICKBOOKS_TRANSPORT_METHOD_ENQUEUE:
                 $ok = $Driver->queueEnqueue($this->_user, $data['action'], $data['ident'], (bool) $data['replace'], (int) $data['priority'], $data['extra'], $data['qbxml']);
                 break;
             case QUICKBOOKS_TRANSPORT_METHOD_EXISTS:
             case QUICKBOOKS_TRANSPORT_METHOD_RECUR:
             default:
                 $errmsg = 'Unimplemented method: ' . $data['method'];
                 break;
         }
     }
     $this->_ack($data, $ok, $data['id'], $errno, $errmsg);
     $this->_done = true;
     return $ok == true;
 }
开发者ID:dsesar,项目名称:quickbooks-php-devkit,代码行数:48,代码来源:Http.php


注:本文中的QuickBooks_Utilities::generateGUID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。