本文整理汇总了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;
}