本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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();
}