Skip to content

EspoCRM – Open Source CRM Application

Use entity::setMulltiple

Yurii80c703af6520
diff --git a/application/Espo/Core/Action/Actions/Merge/Merger.php b/application/Espo/Core/Action/Actions/Merge/Merger.php
index 605fca61ac..36208fe128 100644
--- a/application/Espo/Core/Action/Actions/Merge/Merger.php
+++ b/application/Espo/Core/Action/Actions/Merge/Merger.php
@@ -105,7 +105,7 @@ class Merger
$service->filterUpdateInput($clonedData);
- $entity->set($clonedData);
+ $entity->setMultiple($clonedData);
$this->unsetNotActualAttributes($entity);
diff --git a/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php b/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php
index 33cae4b1ef..19e55cbe74 100644
--- a/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php
+++ b/application/Espo/Core/FieldProcessing/EmailAddress/Saver.php
@@ -334,7 +334,7 @@ class Saver implements SaverInterface
$entityEmailAddress = $this->entityManager->getNewEntity('EntityEmailAddress');
- $entityEmailAddress->set([
+ $entityEmailAddress->setMultiple([
'entityId' => $entity->getId(),
'entityType' => $entity->getEntityType(),
'emailAddressId' => $emailAddress->getId(),
diff --git a/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php b/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php
index 6f91d6eaeb..1c15330343 100644
--- a/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php
+++ b/application/Espo/Core/FieldProcessing/PhoneNumber/Saver.php
@@ -336,7 +336,7 @@ class Saver implements SaverInterface
$entityPhoneNumber = $this->entityManager->getNewEntity('EntityPhoneNumber');
- $entityPhoneNumber->set([
+ $entityPhoneNumber->setMultiple([
'entityId' => $entity->getId(),
'entityType' => $entity->getEntityType(),
'phoneNumberId' => $phoneNumber->getId(),
diff --git a/application/Espo/Core/Repositories/Database.php b/application/Espo/Core/Repositories/Database.php
index 4b1f773549..78aa6be5b3 100644
--- a/application/Espo/Core/Repositories/Database.php
+++ b/application/Espo/Core/Repositories/Database.php
@@ -366,7 +366,7 @@ class Database extends RDBRepository
protected function afterSave(Entity $entity, array $options = [])
{
if (!empty($this->restoreData)) {
- $entity->set($this->restoreData);
+ $entity->setMultiple($this->restoreData);
$this->restoreData = null;
}
diff --git a/application/Espo/ORM/EntityCollection.php b/application/Espo/ORM/EntityCollection.php
index bd650fa217..b846b8c450 100644
--- a/application/Espo/ORM/EntityCollection.php
+++ b/application/Espo/ORM/EntityCollection.php
@@ -252,7 +252,7 @@ class EntityCollection implements Collection, Iterator, Countable, ArrayAccess,
/** @var TEntity $entity */
$entity = $this->entityFactory->create($this->entityType);
- $entity->set($dataArray);
+ $entity->setMultiple($dataArray);
if ($this->isFetched) {
$entity->setAsFetched();
diff --git a/application/Espo/ORM/EntityManager.php b/application/Espo/ORM/EntityManager.php
index a3ec089acd..fb451c6ac3 100644
--- a/application/Espo/ORM/EntityManager.php
+++ b/application/Espo/ORM/EntityManager.php
@@ -303,7 +303,7 @@ class EntityManager
}
}
- $entity->set($fetchedMap);
+ $entity->setMultiple($fetchedMap);
$entity->setAsFetched();
}
@@ -316,7 +316,7 @@ class EntityManager
public function createEntity(string $entityType, $data = [], array $options = []): Entity
{
$entity = $this->getNewEntity($entityType);
- $entity->set($data);
+ $entity->setMultiple($data);
$this->saveEntity($entity, $options);
return $entity;
diff --git a/application/Espo/ORM/Mapper/BaseMapper.php b/application/Espo/ORM/Mapper/BaseMapper.php
index 9ae9521629..b835861de1 100644
--- a/application/Espo/ORM/Mapper/BaseMapper.php
+++ b/application/Espo/ORM/Mapper/BaseMapper.php
@@ -1583,7 +1583,7 @@ class BaseMapper implements RDBMapper
*/
private function populateEntityFromRow(Entity $entity, $data): void
{
- $entity->set($data);
+ $entity->setMultiple($data);
}
/**
diff --git a/application/Espo/ORM/SthCollection.php b/application/Espo/ORM/SthCollection.php
index 8117dbfecc..7e4dbb7975 100644
--- a/application/Espo/ORM/SthCollection.php
+++ b/application/Espo/ORM/SthCollection.php
@@ -85,7 +85,7 @@ class SthCollection implements Collection, IteratorAggregate, Countable
while ($row = $this->fetchRow()) {
$entity = $this->entityManager->getEntityFactory()->create($this->entityType);
- $entity->set($row);
+ $entity->setMultiple($row);
$entity->setAsFetched();
$this->prepareEntity($entity);
diff --git a/application/Espo/ORM/Value/ValueAccessor.php b/application/Espo/ORM/Value/ValueAccessor.php
index 840be59a6c..37daa74d36 100644
--- a/application/Espo/ORM/Value/ValueAccessor.php
+++ b/application/Espo/ORM/Value/ValueAccessor.php
@@ -66,6 +66,6 @@ class ValueAccessor
{
$attributeValueMap = $this->extractor->extract($this->entity->getEntityType(), $field, $value);
- $this->entity->set($attributeValueMap);
+ $this->entity->setMultiple($attributeValueMap);
}
}
diff --git a/application/Espo/Tools/Dashboard/Service.php b/application/Espo/Tools/Dashboard/Service.php
index da7d1878ba..e3fe86624f 100644
--- a/application/Espo/Tools/Dashboard/Service.php
+++ b/application/Espo/Tools/Dashboard/Service.php
@@ -130,7 +130,7 @@ class Service
private function applyTemplate(Entity $preferences, DashboardTemplate $template, bool $append): void
{
if (!$append) {
- $preferences->set([
+ $preferences->setMultiple([
'dashboardLayout' => $template->get('layout'),
'dashletsOptions' => $template->get('dashletsOptions'),
]);
@@ -168,7 +168,7 @@ class Service
$dashletsOptions->$id = $item;
}
- $preferences->set([
+ $preferences->setMultiple([
'dashboardLayout' => $dashboardLayout,
'dashletsOptions' => $dashletsOptions,
]);
diff --git a/application/Espo/Tools/MassUpdate/Processor.php b/application/Espo/Tools/MassUpdate/Processor.php
index 3a8f608fe4..01724a1616 100644
--- a/application/Espo/Tools/MassUpdate/Processor.php
+++ b/application/Espo/Tools/MassUpdate/Processor.php
@@ -192,7 +192,7 @@ class Processor
return false;
}
- $entity->set($values);
+ $entity->setMultiple($values);
try {
$service->processValidation($entity, $values);