mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
type fixes
This commit is contained in:
@@ -49,6 +49,9 @@ class EmailFactory
|
||||
*/
|
||||
public function create(): Email
|
||||
{
|
||||
return $this->entityManager->getNewEntity(Email::ENTITY_TYPE);
|
||||
/** @var Email $email */
|
||||
$email = $this->entityManager->getNewEntity(Email::ENTITY_TYPE);
|
||||
|
||||
return $email;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,10 +100,9 @@ class Importer
|
||||
|
||||
$parser = $message->getParser() ?? $this->parserFactory->create();
|
||||
|
||||
/** @var Email $email */
|
||||
$email = $this->entityManager->getEntity('Email');
|
||||
|
||||
assert($email instanceof Email);
|
||||
|
||||
$email->set('isBeingImported', true);
|
||||
|
||||
$subject = '';
|
||||
@@ -201,6 +200,7 @@ class Importer
|
||||
$duplicate = $this->findDuplicate($email);
|
||||
|
||||
if ($duplicate && $duplicate->get('status') !== Email::STATUS_BEING_IMPORTED) {
|
||||
/** @var Email $duplicate */
|
||||
$duplicate = $this->entityManager->getEntity('Email', $duplicate->getId());
|
||||
|
||||
$this->processDuplicate(
|
||||
@@ -339,6 +339,7 @@ class Importer
|
||||
$this->entityManager->getLocker()->rollback();
|
||||
|
||||
if ($duplicate->get('status') !== Email::STATUS_BEING_IMPORTED) {
|
||||
/** @var Email $duplicate */
|
||||
$duplicate = $this->entityManager->getEntity('Email', $duplicate->getId());
|
||||
|
||||
$this->processDuplicate(
|
||||
@@ -618,6 +619,7 @@ class Importer
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @var Email $duplicate */
|
||||
$duplicate = $this->entityManager
|
||||
->getRDBRepository('Email')
|
||||
->select(['id', 'status'])
|
||||
|
||||
@@ -43,6 +43,9 @@ class XQueueItemId implements Header\HeaderInterface
|
||||
|
||||
protected $id = null;
|
||||
|
||||
/**
|
||||
* @return self
|
||||
*/
|
||||
public static function fromString($headerLine)
|
||||
{
|
||||
list($name, $value) = Header\GenericHeader::splitHeaderLine($headerLine);
|
||||
|
||||
@@ -273,6 +273,7 @@ class MailMimeParser implements Parser
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var Attachment $attachment */
|
||||
$attachment = $this->entityManager->getEntity('Attachment');
|
||||
|
||||
$contentType = $this->detectAttachmentContentType($attachmentPart);
|
||||
|
||||
@@ -380,7 +380,8 @@ class Sender
|
||||
$address = $this->config->get('outboundEmailFromAddress');
|
||||
|
||||
if (!$this->systemInboundEmailIsCached && $address) {
|
||||
$this->systemInboundEmail = $this->entityManager
|
||||
/** @var ?InboundEmail $systemInboundEmail */
|
||||
$systemInboundEmail = $this->entityManager
|
||||
->getRDBRepository('InboundEmail')
|
||||
->where([
|
||||
'status' => 'Active',
|
||||
@@ -388,6 +389,8 @@ class Sender
|
||||
'emailAddress' => $address,
|
||||
])
|
||||
->findOne();
|
||||
|
||||
$this->systemInboundEmail = $systemInboundEmail;
|
||||
}
|
||||
|
||||
$this->systemInboundEmailIsCached = true;
|
||||
|
||||
@@ -49,6 +49,9 @@ class SmsFactory
|
||||
*/
|
||||
public function create(): SmsEntity
|
||||
{
|
||||
return $this->entityManager->getNewEntity(SmsEntity::ENTITY_TYPE);
|
||||
/** @var SmsEntity $sms */
|
||||
$sms = $this->entityManager->getNewEntity(SmsEntity::ENTITY_TYPE);
|
||||
|
||||
return $sms;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user