本文整理汇总了PHP中IMP_Mailbox::hideDeletedMsgs方法的典型用法代码示例。如果您正苦于以下问题:PHP IMP_Mailbox::hideDeletedMsgs方法的具体用法?PHP IMP_Mailbox::hideDeletedMsgs怎么用?PHP IMP_Mailbox::hideDeletedMsgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMP_Mailbox
的用法示例。
在下文中一共展示了IMP_Mailbox::hideDeletedMsgs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unseenMessages
/**
* Get the list of unseen messages in the mailbox (IMAP UNSEEN flag, with
* UNDELETED if we're hiding deleted messages).
*
* @param integer $results A Horde_Imap_Client::SEARCH_RESULTS_* constant
* that indicates the desired return type.
* @param array $opts Additional options:
* - sort: (array) List of sort criteria to use.
* - uids: (boolean) Return UIDs instead of sequence numbers (for
* $results queries that return message lists).
* DEFAULT: false
*
* @return mixed Whatever is requested in $results.
*/
public function unseenMessages($results, array $opts = array())
{
$count = $results == Horde_Imap_Client::SEARCH_RESULTS_COUNT;
if (empty($this->_sorted)) {
return $count ? 0 : array();
}
$criteria = new Horde_Imap_Client_Search_Query();
$imp_imap = $this->_mailbox->imp_imap;
if ($this->_mailbox->hideDeletedMsgs()) {
$criteria->flag(Horde_Imap_Client::FLAG_DELETED, false);
} elseif ($count) {
try {
$status_res = $imp_imap->status($this->_mailbox, Horde_Imap_Client::STATUS_UNSEEN);
return $status_res['unseen'];
} catch (IMP_Imap_Exception $e) {
return 0;
}
}
$criteria->flag(Horde_Imap_Client::FLAG_SEEN, false);
try {
$res = $imp_imap->search($this->_mailbox, $criteria, array('results' => array($results), 'sequence' => empty($opts['uids']), 'sort' => empty($opts['sort']) ? null : $opts['sort']));
return $count ? $res['count'] : $res;
} catch (IMP_Imap_Exception $e) {
return $count ? 0 : array();
}
}
示例2: moveAfterAction
/**
* Increment mailbox index after deleting a message?
*
* @param IMP_Mailbox $mailbox Current mailbox.
*
* @return boolean If true, increments index.
*/
public function moveAfterAction(IMP_Mailbox $mailbox)
{
return !$mailbox->hideDeletedMsgs() && !$GLOBALS['prefs']->getValue('use_trash');
}