public function testImapFolderGetterAndSetter() { $folder = new ImapEmailFolder(); $imapEmail = new ImapEmail(); $this->assertNull($imapEmail->getImapFolder()); $imapEmail->setImapFolder($folder); $this->assertSame($folder, $imapEmail->getImapFolder()); }
/** * Removes an email from a folder linked to the given IMAP email object * * @param ImapEmail $imapEmail */ protected function removeImapEmailReference(ImapEmail $imapEmail) { $this->logger->notice(sprintf('Remove "%s" (UID: %d) email from "%s".', $imapEmail->getEmail()->getSubject(), $imapEmail->getUid(), $imapEmail->getImapFolder()->getFolder()->getFullName())); $emailUser = $imapEmail->getEmail()->getEmailUserByFolder($imapEmail->getImapFolder()->getFolder()); if ($emailUser != null) { $imapEmail->getEmail()->getEmailUsers()->removeElement($emailUser); } $this->em->remove($imapEmail); }
/** * Removes an email from a folder linked to the given IMAP email object * * @param ImapEmail $imapEmail */ protected function removeImapEmailReference(ImapEmail $imapEmail) { $this->log->notice(sprintf('Remove "%s" (UID: %d) email from "%s".', $imapEmail->getEmail()->getSubject(), $imapEmail->getUid(), $imapEmail->getImapFolder()->getFolder()->getFullName())); $imapEmail->getEmail()->removeFolder($imapEmail->getImapFolder()->getFolder()); $this->em->remove($imapEmail); }