setMetaData() public method

Set metadata information for a mailbox.
public setMetaData ( string $mailbox, integer $uidvalid, array $data = [] )
$mailbox string An IMAP mailbox string.
$uidvalid integer The IMAP uidvalidity value of the mailbox.
$data array The list of data to save. The keys are the metadata IDs, the values are the associated data. The following labels are reserved: 'uidvalid'.
Exemplo n.º 1
0
Arquivo: Base.php Projeto: Gomez/horde
 /**
  * Updates the cached MODSEQ value.
  *
  * @param integer $modseq  MODSEQ value to store.
  *
  * @return mixed  The MODSEQ of the old value if it was replaced (or false
  *                if it didn't exist or is the same).
  */
 protected function _updateModSeq($modseq)
 {
     if (!$this->_initCache(true)) {
         return false;
     }
     $mbox_ob = $this->_mailboxOb();
     $uidvalid = $mbox_ob->getStatus(Horde_Imap_Client::STATUS_UIDVALIDITY);
     $md = $this->_cache->getMetaData($this->_selected, $uidvalid, array(self::CACHE_MODSEQ));
     if (isset($md[self::CACHE_MODSEQ])) {
         if ($md[self::CACHE_MODSEQ] < $modseq) {
             $set = true;
             $sync = $md[self::CACHE_MODSEQ];
         } else {
             $set = false;
             $sync = 0;
         }
         $mbox_ob->setStatus(Horde_Imap_Client::STATUS_SYNCMODSEQ, $md[self::CACHE_MODSEQ]);
     } else {
         $set = true;
         $sync = 0;
     }
     /* $modseq can be 0 - NOMODSEQ - so don't store in that case. */
     if ($set && $modseq) {
         $this->_cache->setMetaData($this->_selected, $uidvalid, array(self::CACHE_MODSEQ => $modseq));
     }
     return $sync;
 }
Exemplo n.º 2
0
 /**
  * Updates metadata for a mailbox.
  *
  * @param string $mailbox    Mailbox to update.
  * @param string $data       The data to update.
  * @param integer $uidvalid  The uidvalidity of the mailbox.  If not set,
  *                           do a status call to grab it.
  */
 protected function _updateMetaData($mailbox, $data, $uidvalid = null)
 {
     if (is_null($uidvalid)) {
         $status = $this->status($mailbox, Horde_Imap_Client::STATUS_UIDVALIDITY);
         $uidvalid = $status['uidvalidity'];
     }
     $this->_cache->setMetaData($mailbox, $uidvalid, $data);
 }