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


PHP QuickBooks_Utilities::objectToAdd方法代码示例

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


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

示例1: mark

 public function mark($mark_as, $object_or_action, $ID, $TxnID_or_ListID = null, $errnum = null, $errmsg = null, $mark_as_dequeued = true)
 {
     $Driver = $this->_driver;
     $object = QuickBooks_Utilities::actionToObject($object_or_action);
     $table_and_field = array();
     // Convert to table and primary key, select qbsql id
     QuickBooks_SQL_Schema::mapPrimaryKey($object, QUICKBOOKS_SQL_SCHEMA_MAP_TO_SQL, $table_and_field);
     if (!empty($table_and_field[0]) and !empty($table_and_field[1])) {
         switch ($mark_as) {
             case QuickBooks_Map::MARK_ADD:
                 $arr = array();
                 $where = array(array(QUICKBOOKS_DRIVER_SQL_FIELD_ID => $ID));
                 if ($TxnID_or_ListID) {
                     $arr[$table_and_field[1]] = $TxnID_or_ListID;
                     // Get the existing temporary ID
                     $errnum = null;
                     $errmsg = null;
                     $existing = $Driver->fetch($Driver->query("SELECT " . $table_and_field[1] . " FROM " . QUICKBOOKS_DRIVER_SQL_PREFIX_SQL . $table_and_field[0] . " WHERE " . QUICKBOOKS_DRIVER_SQL_FIELD_ID . " = " . $ID, $errnum, $errmsg));
                     if (!$existing) {
                         return false;
                     }
                     $existing_TxnID_or_ListID = $existing[$table_and_field[1]];
                 }
                 $resync = true;
                 $discov = true;
                 if ($errnum) {
                     $arr[QUICKBOOKS_DRIVER_SQL_FIELD_ERROR_NUMBER] = $errnum;
                     $arr[QUICKBOOKS_DRIVER_SQL_FIELD_ERROR_MESSAGE] = $errmsg;
                     // Don't mark it as synced/discovered if there was an error
                     $resync = false;
                     $discov = false;
                 }
                 /*
                 if ($mark_as_dequeued)
                 {
                 	$arr[QUICKBOOKS_DRIVER_SQL_FIELD_ENQUEUE_TIME] = date('Y-m-d H:i:s');
                 }
                 */
                 $Driver->update(QUICKBOOKS_DRIVER_SQL_PREFIX_SQL . $table_and_field[0], $arr, $where, $resync, $discov);
                 if ($TxnID_or_ListID) {
                     $Object = new QuickBooks_SQL_Object($table_and_field[0], '', array());
                     $Object->set($table_and_field[1], $TxnID_or_ListID);
                     $action = QuickBooks_Utilities::objectToAdd($object_or_action);
                     $this->_updateRelatives($table_and_field[0], $action, $Object, $existing_TxnID_or_ListID);
                 }
                 break;
         }
     }
     return false;
 }
开发者ID:djeraseit,项目名称:quickbooks-php,代码行数:50,代码来源:Qbxml.php


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