예제 #1
0
 /**
  * @param int $pageNumber
  * @param Folder $folder
  * @return WebMailMessageCollection
  */
 function &LoadMessageHeaders($pageNumber, &$folder)
 {
     $mailCollection = null;
     if (!$this->_dbConnection->Execute($this->_commandCreator->LoadMessageHeaders($pageNumber, $folder, $this->Account))) {
         return $mailCollection;
     }
     $mailCollection =& new WebMailMessageCollection();
     while ($row = $this->_dbConnection->GetNextRecord()) {
         $msg =& new WebMailMessage();
         $msg->SetFromAsString($row->from_msg);
         $msg->SetToAsString($row->to_msg);
         $msg->SetCcAsString($row->cc_msg);
         $msg->SetBccAsString($row->bcc_msg);
         $date =& new CDateTime();
         $date->SetFromANSI($row->nmsg_date);
         $date->TimeStamp += $date->GetServerTimeZoneOffset();
         $msg->SetDate($date);
         $msg->SetSubject($row->subject);
         $msg->IdMsg = $row->id_msg;
         $msg->IdFolder = $row->id_folder_db;
         $msg->Uid = $row->uid;
         $msg->Size = $row->size;
         $msg->DbPriority = $row->priority;
         $msg->DbXSpam = (bool) abs($row->x_spam);
         $msg->DbHasAttachments = $row->attachments;
         $msg->Flags = 0;
         if ($row->seen) {
             $msg->Flags |= MESSAGEFLAGS_Seen;
         }
         if ($row->flagged) {
             $msg->Flags |= MESSAGEFLAGS_Flagged;
         }
         if ($row->deleted) {
             $msg->Flags |= MESSAGEFLAGS_Deleted;
         }
         if ($row->replied) {
             $msg->Flags |= MESSAGEFLAGS_Answered;
         }
         if ($row->forwarded) {
             $msg->Flags |= MESSAGEFLAGS_Forwarded;
         }
         if ($row->grayed) {
             $msg->Flags |= MESSAGEFLAGS_Grayed;
         }
         $msg->Charset = $row->charset;
         $mailCollection->Add($msg);
     }
     return $mailCollection;
 }
예제 #2
0
 /**
  * @param int $pageNumber
  * @param Folder $folder
  * @return WebMailMessageCollection
  */
 function &LoadMessageHeaders($pageNumber, &$folder)
 {
     $mailCollection = null;
     if (!$this->_dbConnection->Execute($this->_commandCreator->LoadMessageHeaders($pageNumber, $folder, $this->Account))) {
         return $mailCollection;
     }
     $mailCollection = new WebMailMessageCollection();
     while (false !== ($row = $this->_dbConnection->GetNextRecord())) {
         $msg =& $this->_rowToWebMailMessage($row);
         $mailCollection->Add($msg);
         unset($msg);
     }
     $this->_dbConnection->FreeResult();
     return $mailCollection;
 }