Skip to content

EspoCRM – Open Source CRM Application

method usage fix

Yurii04794bb2aa6d
diff --git a/application/Espo/Classes/AssignmentNotificators/Email.php b/application/Espo/Classes/AssignmentNotificators/Email.php
index 343120bfd0..84087b0c69 100644
--- a/application/Espo/Classes/AssignmentNotificators/Email.php
+++ b/application/Espo/Classes/AssignmentNotificators/Email.php
@@ -280,7 +280,7 @@ class Email implements AssignmentNotificator
->setType(Notification::TYPE_EMAIL_RECEIVED)
->setUserId($userId)
->setData($data)
- ->setRelated(LinkParent::createFromEntity($entity))
+ ->setRelated(LinkParent::fromEntity($entity))
->setActionId($params->getActionId());
$this->entityManager->saveEntity($notification);
diff --git a/application/Espo/Core/Mail/Importer/DefaultImporter.php b/application/Espo/Core/Mail/Importer/DefaultImporter.php
index 5491120c27..de82eb8703 100644
--- a/application/Espo/Core/Mail/Importer/DefaultImporter.php
+++ b/application/Espo/Core/Mail/Importer/DefaultImporter.php
@@ -613,7 +613,7 @@ class DefaultImporter implements Importer
{
foreach ($inlineAttachmentList as $attachment) {
$attachment->setTargetField('body');
- $attachment->setRelated(LinkParent::createFromEntity($email));
+ $attachment->setRelated(LinkParent::fromEntity($email));
$this->entityManager->saveEntity($attachment);
}
diff --git a/application/Espo/Core/Notification/DefaultAssignmentNotificator.php b/application/Espo/Core/Notification/DefaultAssignmentNotificator.php
index d6e6ce403b..8cefd92ae0 100644
--- a/application/Espo/Core/Notification/DefaultAssignmentNotificator.php
+++ b/application/Espo/Core/Notification/DefaultAssignmentNotificator.php
@@ -127,7 +127,7 @@ class DefaultAssignmentNotificator implements AssignmentNotificator
'userId' => $this->user->getId(),
'userName' => $this->user->getName(),
])
- ->setRelated(LinkParent::createFromEntity($entity));
+ ->setRelated(LinkParent::fromEntity($entity));
$this->entityManager->saveEntity($notification);
}
diff --git a/application/Espo/Core/Record/ActionHistory/DefaultActionLogger.php b/application/Espo/Core/Record/ActionHistory/DefaultActionLogger.php
index ac4d388a0b..38ae422fa0 100644
--- a/application/Espo/Core/Record/ActionHistory/DefaultActionLogger.php
+++ b/application/Espo/Core/Record/ActionHistory/DefaultActionLogger.php
@@ -57,7 +57,7 @@ class DefaultActionLogger implements ActionLogger
->setAuthTokenId($this->user->get('authTokenId'))
->setAuthLogRecordId($this->user->get('authLogRecordId'))
->setIpAddress($this->user->get('ipAddress'))
- ->setTarget(LinkParent::createFromEntity($entity));
+ ->setTarget(LinkParent::fromEntity($entity));
$this->entityManager->saveEntity($historyRecord);
}
diff --git a/application/Espo/Modules/Crm/Business/Event/Invitations.php b/application/Espo/Modules/Crm/Business/Event/Invitations.php
index 688d3834e1..39cc3ea151 100644
--- a/application/Espo/Modules/Crm/Business/Event/Invitations.php
+++ b/application/Espo/Modules/Crm/Business/Event/Invitations.php
@@ -151,7 +151,7 @@ class Invitations
->setSubject($subject)
->setBody($body)
->setIsHtml()
- ->setParent(LinkParent::createFromEntity($entity));
+ ->setParent(LinkParent::fromEntity($entity));
$attachmentName = ucwords($this->language->translateLabel($entity->getEntityType(), 'scopeNames')) . '.ics';
@@ -195,7 +195,7 @@ class Invitations
$terminateAt = $dt->format(DateTimeUtil::SYSTEM_DATE_TIME_FORMAT);
}
- $uid->setTarget(LinkParent::createFromEntity($entity));
+ $uid->setTarget(LinkParent::fromEntity($entity));
$uid->setTerminateAt(DateTimeField::fromString($terminateAt));
$this->entityManager->saveEntity($uid);
diff --git a/application/Espo/Modules/Crm/Classes/AssignmentNotificators/Meeting.php b/application/Espo/Modules/Crm/Classes/AssignmentNotificators/Meeting.php
index ff9477b5e8..143a3a3ba2 100644
--- a/application/Espo/Modules/Crm/Classes/AssignmentNotificators/Meeting.php
+++ b/application/Espo/Modules/Crm/Classes/AssignmentNotificators/Meeting.php
@@ -114,7 +114,7 @@ class Meeting implements AssignmentNotificator
$notification
->setType(self::NOTIFICATION_TYPE_EVENT_ATTENDEE)
->setUserId($userId)
- ->setRelated(LinkParent::createFromEntity($entity))
+ ->setRelated(LinkParent::fromEntity($entity))
->setData([
'entityType' => $entity->getEntityType(),
'entityId' => $entity->getId(),
diff --git a/application/Espo/Tools/Email/Api/PostUsers.php b/application/Espo/Tools/Email/Api/PostUsers.php
index 34199dc35c..753d9d5a8f 100644
--- a/application/Espo/Tools/Email/Api/PostUsers.php
+++ b/application/Espo/Tools/Email/Api/PostUsers.php
@@ -164,7 +164,7 @@ class PostUsers implements Action
$notification
->setType('EmailInbox')
- ->setRelated(LinkParent::createFromEntity($email))
+ ->setRelated(LinkParent::fromEntity($email))
->setUserId($user->getId())
->setData([
'emailName' => $email->getSubject(),
diff --git a/application/Espo/Tools/Notification/CollaboratorsNotificator.php b/application/Espo/Tools/Notification/CollaboratorsNotificator.php
index ec637f7d16..e1eec02f2d 100644
--- a/application/Espo/Tools/Notification/CollaboratorsNotificator.php
+++ b/application/Espo/Tools/Notification/CollaboratorsNotificator.php
@@ -79,7 +79,7 @@ class CollaboratorsNotificator
'relatedName' => $entity->get(Field::NAME),
'createdByName' => $this->user->getName(),
])
- ->setRelated(LinkParent::createFromEntity($entity))
+ ->setRelated(LinkParent::fromEntity($entity))
->setActionId($params->getActionId());
$this->entityManager->saveEntity($notification);
diff --git a/application/Espo/Tools/Notification/Service.php b/application/Espo/Tools/Notification/Service.php
index f4119c2940..08c985d121 100644
--- a/application/Espo/Tools/Notification/Service.php
+++ b/application/Espo/Tools/Notification/Service.php
@@ -61,7 +61,7 @@ class Service
->setType(Notification::TYPE_MENTION_IN_POST)
->setData(['noteId' => $note->getId()])
->setUserId($userId)
- ->setRelated(LinkParent::createFromEntity($note));
+ ->setRelated(LinkParent::fromEntity($note));
$this->entityManager->saveEntity($notification);
}
@@ -140,7 +140,7 @@ class Service
->setData(['noteId' => $note->getId()])
->setType(Notification::TYPE_NOTE)
->setUserId($user->getId())
- ->setRelated(LinkParent::createFromEntity($note))
+ ->setRelated(LinkParent::fromEntity($note))
->setRelatedParent(
$note->getParentType() && $note->getParentId() ?
LinkParent::create($note->getParentType(), $note->getParentId()) : null
diff --git a/application/Espo/Tools/Stream/Service.php b/application/Espo/Tools/Stream/Service.php
index 1ce525b43d..70775befbd 100644
--- a/application/Espo/Tools/Stream/Service.php
+++ b/application/Espo/Tools/Stream/Service.php
@@ -587,7 +587,7 @@ class Service
$note = $this->getNewNote();
$note->setType(Note::TYPE_CREATE);
- $note->setParent(LinkParent::createFromEntity($entity));
+ $note->setParent(LinkParent::fromEntity($entity));
$this->setSuperParent($entity, $note, true);
@@ -751,7 +751,7 @@ class Service
$note = $this->getNewNote();
$note->setType(Note::TYPE_ASSIGN);
- $note->setParent(LinkParent::createFromEntity($entity));
+ $note->setParent(LinkParent::fromEntity($entity));
$this->setSuperParent($entity, $note, true);
$this->setAssignData($entity, $note);
@@ -912,7 +912,7 @@ class Service
$note = $this->getNewNote();
$note->setType(Note::TYPE_UPDATE);
- $note->setParent(LinkParent::createFromEntity($entity));
+ $note->setParent(LinkParent::fromEntity($entity));
$note->setData([
'fields' => $updatedFieldList,
diff --git a/application/Espo/Tools/UserReaction/NotificationService.php b/application/Espo/Tools/UserReaction/NotificationService.php
index 3daf3be065..0d66e6a7e5 100644
--- a/application/Espo/Tools/UserReaction/NotificationService.php
+++ b/application/Espo/Tools/UserReaction/NotificationService.php
@@ -83,7 +83,7 @@ class NotificationService
$notification
->setType(Notification::TYPE_USER_REACTION)
->setUserId($recipientId)
- ->setRelated(LinkParent::createFromEntity($note));
+ ->setRelated(LinkParent::fromEntity($note));
if ($parent instanceof Entity) {
$notification->setRelatedParent($parent);