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