Example #1
0
 public function testEmailsGetterAndSetter()
 {
     $email = $this->getMock('Oro\\Bundle\\EmailBundle\\Entity\\Email');
     $entity = new EmailThread();
     $entity->addEmail($email);
     $this->assertTrue($email === $entity->getEmails()->first());
 }
Example #2
0
 /**
  * @param Email       $email
  * @param EmailThread $thread
  */
 protected function processThread(Email $email, EmailThread $thread)
 {
     if ($email->getId()) {
         if (!$email->getThread() || $email->getThread()->getId() != $thread->getId()) {
             throw $this->createInvalidPropertyException('Thread', $email->getThread() ? $email->getThread()->getId() : null, $thread->getId());
         }
     } else {
         $email->setThread($thread);
     }
 }