コード例 #1
0
ファイル: MailEntry.php プロジェクト: brendt/ridme
 /**
  * Gets the state of the entry
  * @return null
  */
 public function getEntryState()
 {
     $entryState = parent::getEntryState();
     if ($entryState !== self::STATE_CLEAN || isset($this->checkEntryState)) {
         return $entryState;
     }
     $this->checkEntryState = true;
     $entryState = null;
     if (!$entryState && $this->sender && $this->sender->getEntryState() !== self::STATE_CLEAN) {
         $entryState = self::STATE_DIRTY;
     }
     if (!$entryState && $this->cc) {
         foreach ($this->cc as $value) {
             if ($value->getEntryState() !== self::STATE_CLEAN) {
                 $entryState = self::STATE_DIRTY;
                 break;
             }
         }
     }
     if (!$entryState && $this->bcc) {
         foreach ($this->bcc as $value) {
             if ($value->getEntryState() !== self::STATE_CLEAN) {
                 $entryState = self::STATE_DIRTY;
                 break;
             }
         }
     }
     if (!$entryState) {
         $entryState = self::STATE_CLEAN;
     }
     unset($this->checkEntryState);
     return $entryState;
 }
コード例 #2
0
 /**
  * Gets the state of the entry
  * @return null
  */
 public function getEntryState()
 {
     $entryState = parent::getEntryState();
     if ($entryState !== self::STATE_CLEAN || isset($this->checkEntryState)) {
         return $entryState;
     }
     $this->checkEntryState = true;
     $entryState = null;
     if (!$entryState && $this->mail && $this->mail->getEntryState() !== self::STATE_CLEAN) {
         $entryState = self::STATE_DIRTY;
     }
     if (!$entryState && $this->mailAddress && $this->mailAddress->getEntryState() !== self::STATE_CLEAN) {
         $entryState = self::STATE_DIRTY;
     }
     if (!$entryState) {
         $entryState = self::STATE_CLEAN;
     }
     unset($this->checkEntryState);
     return $entryState;
 }