当前位置: 首页>>代码示例>>PHP>>正文


PHP Email::getThread方法代码示例

本文整理汇总了PHP中Oro\Bundle\EmailBundle\Entity\Email::getThread方法的典型用法代码示例。如果您正苦于以下问题:PHP Email::getThread方法的具体用法?PHP Email::getThread怎么用?PHP Email::getThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Oro\Bundle\EmailBundle\Entity\Email的用法示例。


在下文中一共展示了Email::getThread方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getThreadEmails

 /**
  * Get emails in thread of current one
  *
  * @param EntityManager $entityManager
  * @param Email $entity
  *
  * @return Email[]
  */
 public function getThreadEmails(EntityManager $entityManager, Email $entity)
 {
     $thread = $entity->getThread();
     if ($thread) {
         /** @var QueryBuilder $queryBuilder */
         $queryBuilder = $entityManager->getRepository('OroEmailBundle:Email')->createQueryBuilder('e');
         $criteria = new Criteria();
         $criteria->where($criteria->expr()->eq('thread', $thread));
         $criteria->orderBy(['sentAt' => Criteria::DESC]);
         $queryBuilder->addCriteria($criteria);
         $result = $queryBuilder->getQuery()->getResult();
     } else {
         $result = [$entity];
     }
     return $result;
 }
开发者ID:Maksold,项目名称:platform,代码行数:24,代码来源:EmailThreadProvider.php

示例2: updateRefs

 /**
  * Updates email references' threadId
  *
  * @param EntityManager $entityManager
  * @param Email $entity
  */
 protected function updateRefs(EntityManager $entityManager, Email $entity)
 {
     if ($entity->getThread()) {
         /** @var Email $email */
         foreach ($this->emailThreadProvider->getEmailReferences($this->em, $entity) as $email) {
             if (!$email->getThread()) {
                 $email->setThread($entity->getThread());
                 $entityManager->persist($email);
             }
         }
     }
 }
开发者ID:startupz,项目名称:platform-1,代码行数:18,代码来源:EmailThreadManager.php

示例3: setReplaedEmailId

 /**
  * @param Email $email
  * @param $data
  *
  * @return mixed
  */
 protected function setReplaedEmailId($email, $data)
 {
     if ($email->getThread()) {
         $emails = $email->getThread()->getEmails();
         // if there are just two email - add replayedEmailId to use on client side
         if (count($emails) === 2) {
             $data['replayedEmailId'] = $emails[0]->getId();
         }
     }
     return $data;
 }
开发者ID:paulstoica,项目名称:platform,代码行数:17,代码来源:EmailActivityListProvider.php

示例4: prepareFlaggedEmailEntities

 /**
  * Prepare emails to set status. If need get all from thread
  *
  * @param Email $entity
  * @param bool $checkThread Get threaded emails
  *
  * @return Email[]
  */
 protected function prepareFlaggedEmailEntities(Email $entity, $checkThread)
 {
     $thread = $entity->getThread();
     $emails = [$entity];
     if ($checkThread && $thread) {
         $emails = $thread->getEmails();
         return $emails->toArray();
     }
     return $emails;
 }
开发者ID:antrampa,项目名称:platform,代码行数:18,代码来源:EmailManager.php

示例5: getAllEmailUsersByEmail

 /**
  * Gets array of EmailUser's by Email or EmailThread of this email depends on $checkThread flag
  * for current user and organization or which have mailbox owner.
  *
  * @param Email        $email
  * @param User         $user
  * @param Organization $organization
  * @param bool|false   $checkThread
  *
  * @return EmailUser[]
  */
 public function getAllEmailUsersByEmail(Email $email, User $user, Organization $organization, $checkThread = false)
 {
     $parameters = [];
     $queryBuilder = $this->createQueryBuilder('eu')->join('eu.email', 'e');
     if ($checkThread && ($thread = $email->getThread())) {
         $queryBuilder->andWhere('e.thread = :thread');
         $parameters['thread'] = $thread;
     } else {
         $queryBuilder->andWhere('eu.email = :email');
         $parameters['email'] = $email;
     }
     $orx = $queryBuilder->expr()->orX();
     $orx->add('eu.mailboxOwner IS NOT NULL')->add('eu.owner = :owner AND eu.organization = :organization');
     return $queryBuilder->andWhere($orx)->setParameters(array_merge($parameters, ['owner' => $user, 'organization' => $organization]))->getQuery()->getResult();
 }
开发者ID:woei66,项目名称:platform,代码行数:26,代码来源:EmailUserRepository.php

示例6: addContextsToThread

 /**
  * @param EntityManager $em
  * @param Email         $email
  * @param [] $contexts
  */
 protected function addContextsToThread(EntityManager $em, Email $email, $contexts)
 {
     $thread = $email->getThread();
     if ($thread) {
         $relatedEmails = $em->getRepository(Email::ENTITY_CLASS)->findByThread($thread);
     } else {
         $relatedEmails = [$email];
     }
     if (count($contexts) > 0) {
         foreach ($relatedEmails as $relatedEmail) {
             foreach ($contexts as $context) {
                 $this->addAssociation($relatedEmail, $context);
             }
         }
     }
 }
开发者ID:hugeval,项目名称:platform,代码行数:21,代码来源:EmailActivityManager.php

示例7: processThread

 /**
  * @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);
     }
 }
开发者ID:nmallare,项目名称:platform,代码行数:14,代码来源:EmailApiHandler.php


注:本文中的Oro\Bundle\EmailBundle\Entity\Email::getThread方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。