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


PHP Email::getId方法代码示例

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


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

示例1: getEmailContext

 /**
  * Returns the context for the given email
  *
  * @param Email $email
  *
  * @return array
  */
 public function getEmailContext(Email $email)
 {
     $criteria = Criteria::create();
     $criteria->andWhere(Criteria::expr()->eq('id', $email->getId()));
     $qb = $this->activityManager->getActivityTargetsQueryBuilder($this->class, $criteria);
     if (null === $qb) {
         return [];
     }
     $result = $qb->getQuery()->getResult();
     if (empty($result)) {
         return $result;
     }
     $currentUser = $this->securityFacade->getLoggedUser();
     $currentUserClass = ClassUtils::getClass($currentUser);
     $currentUserId = $currentUser->getId();
     $result = array_values(array_filter($result, function ($item) use($currentUserClass, $currentUserId) {
         return !($item['entity'] === $currentUserClass && $item['id'] == $currentUserId);
     }));
     foreach ($result as &$item) {
         $route = $this->configManager->getEntityMetadata($item['entity'])->getRoute();
         $item['entityId'] = $email->getId();
         $item['targetId'] = $item['id'];
         $item['targetClassName'] = $this->entityClassNameHelper->getUrlSafeClassName($item['entity']);
         $item['icon'] = $this->configManager->getProvider('entity')->getConfig($item['entity'])->get('icon');
         $item['link'] = $route ? $this->router->generate($route, ['id' => $item['id']]) : null;
         unset($item['id'], $item['entity']);
     }
     return $result;
 }
开发者ID:nmallare,项目名称:platform,代码行数:36,代码来源:EmailApiEntityManager.php

示例2: setFlags

 /**
  * (@inherit)
  */
 public function setFlags(EmailFolder $folder, Email $email, $flags)
 {
     $repoImapEmail = $this->em->getRepository('OroImapBundle:ImapEmail');
     $uid = $repoImapEmail->getUid($folder->getId(), $email->getId());
     $this->connector->selectFolder($folder->getFullName());
     $this->connector->setFlags($uid, $flags);
 }
开发者ID:Maksold,项目名称:platform,代码行数:10,代码来源:ImapEmailFlagManager.php

示例3: createForwardEmailModel

 /**
  * @param EmailEntity $parentEmailEntity
  *
  * @return EmailModel
  */
 public function createForwardEmailModel(EmailEntity $parentEmailEntity)
 {
     $emailModel = $this->factory->getEmail();
     $emailModel->setMailType(EmailModel::MAIL_TYPE_FORWARD);
     $emailModel->setParentEmailId($parentEmailEntity->getId());
     $emailModel->setSubject($this->helper->prependWith('Fwd: ', $parentEmailEntity->getSubject()));
     $body = $this->helper->getEmailBody($parentEmailEntity, 'OroEmailBundle:Email/Forward:parentBody.html.twig');
     $emailModel->setBodyFooter($body);
     // link attachments of forwarded email to current email instance
     if ($this->request->isMethod('GET')) {
         $this->applyAttachments($emailModel, $parentEmailEntity);
     }
     return $this->createEmailModel($emailModel);
 }
开发者ID:ramunasd,项目名称:platform,代码行数:19,代码来源:EmailModelBuilder.php

示例4: processRefs

 /**
  * @param Email  $email
  * @param string $refs
  */
 protected function processRefs(Email $email, $refs)
 {
     if ($email->getId()) {
         if (!$this->areRefsEqual($email->getRefs(), $refs)) {
             throw $this->createInvalidPropertyException('Refs', $this->convertRefsToString($email->getRefs()), $this->convertRefsToString($refs));
         }
     } else {
         $email->setRefs($refs);
     }
 }
开发者ID:nmallare,项目名称:platform,代码行数:14,代码来源:EmailApiHandler.php

示例5: getAssignedEntities

 /**
  * @param Email $email
  *
  * @return array of [id, entity, title]
  */
 protected function getAssignedEntities(Email $email)
 {
     $queryBuilder = $this->activityManager->getActivityTargetsQueryBuilder($this->class, ['id' => $email->getId()]);
     return $queryBuilder->getQuery()->getArrayResult();
 }
开发者ID:ramunasd,项目名称:platform,代码行数:10,代码来源:EmailActivitySuggestionApiEntityManager.php


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