當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Horde_Serialize::Serialize方法代碼示例

本文整理匯總了PHP中Horde_Serialize::Serialize方法的典型用法代碼示例。如果您正苦於以下問題:PHP Horde_Serialize::Serialize方法的具體用法?PHP Horde_Serialize::Serialize怎麽用?PHP Horde_Serialize::Serialize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Horde_Serialize的用法示例。


在下文中一共展示了Horde_Serialize::Serialize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: commit


//.........這裏部分代碼省略.........
                     $oldOwners = reset($owners);
                 } else {
                     $oldOwners = array();
                 }
                 $this->_changes['oldowners'] = $oldOwners;
                 foreach ($value as $owner) {
                     if (!$oldOwners || array_search($owner, $oldOwners) === false) {
                         $whups_driver->addTicketOwner($this->_id, $owner);
                         $whups_driver->updateLog($this->_id, $user, array('assign' => $owner), $transaction);
                     } else {
                         // Remove $owner from the old owners list; anyone left
                         // in $oldOwners will be removed.
                         unset($oldOwners[array_search($owner, $oldOwners)]);
                     }
                 }
                 // Delete removed owners and log the removals.
                 if (is_array($oldOwners)) {
                     foreach ($oldOwners as $owner) {
                         $whups_driver->deleteTicketOwner($this->_id, $owner);
                         $whups_driver->updateLog($this->_id, $user, array('unassign' => $owner), $transaction);
                     }
                 }
                 break;
             case 'comment':
                 $commentId = $whups_driver->addComment($this->_id, $value, $user, $author_email);
                 // Store the comment id in the updates array for the log.
                 $updates['comment'] = $commentId;
                 if (!empty($this->_changes['comment-perms'])) {
                     $this->addCommentPerms($commentId, $this->_changes['comment-perms']['to']);
                 }
                 break;
             case 'comment-email':
             case 'comment-perms':
                 // Skip these, handled in the comment case.
                 break;
             case 'message':
                 if (isset($conf['vfs']['type'])) {
                     $updates['message'] = $this->addMessage($value);
                 }
                 break;
             case 'delete-message':
                 if (isset($conf['vfs']['type'])) {
                     $this->deleteMessage($value);
                     // Store the deleted message id in the updates array for the
                     // log.
                     $updates['delete-message'] = $value;
                 }
                 break;
             case 'attachment':
                 $this->addAttachment($value['name'], $value['tmp_name']);
                 // Store the new file name in the updates array for the
                 // log.
                 $updates['attachment'][] = $value['name'];
                 break;
             case 'attachments':
                 foreach ($value as $attachment) {
                     $this->addAttachment($attachment['name'], $attachment['tmp_name']);
                     // Store the new file name in the updates array for the
                     // log.
                     $updates['attachment'][] = $attachment['name'];
                 }
                 break;
             case 'delete-attachment':
                 $this->deleteAttachment($value);
                 // Store the deleted file name in the updates array for
                 // the log.
                 $updates['delete-attachment'] = $value;
                 break;
             case 'queue':
                 // Reset version if new queue is not versioned.
                 $newqueue = $whups_driver->getQueue($value);
                 if (empty($newqueue['queue_versioned'])) {
                     $updates['version'] = 0;
                 }
                 $updates['queue'] = $value;
                 break;
             default:
                 if (strpos($detail, 'attribute_') === 0 && !is_string($value)) {
                     $value = Horde_Serialize::Serialize($value, Horde_Serialize::JSON);
                 }
                 $updates[$detail] = $value;
                 break;
         }
     }
     if (count($updates)) {
         $whups_driver->updateTicket($this->_id, $updates);
         $whups_driver->updateLog($this->_id, $user, $updates, $transaction);
     }
     // Reload $this->_details to make sure we have the latest information.
     //
     // @todo Only touch the db if we have to.
     $details = $whups_driver->getTicketDetails($this->_id);
     $this->_details = array_merge($this->_details, $details);
     // Send notification emails to all ticket listeners.
     if ($notify) {
         $this->notify($user, false);
     }
     // Reset the changes array.
     $this->_changes = array();
 }
開發者ID:horde,項目名稱:horde,代碼行數:101,代碼來源:Ticket.php


注:本文中的Horde_Serialize::Serialize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。