Skip to content

EspoCRM – Open Source CRM Application

Rename

Yurii25b9184043eb
diff --git a/application/Espo/Core/Acl/Events/UserRoleUpdate.php b/application/Espo/Core/Acl/Events/UserRoleUpdate.php
index 4275e88bed..a0e62a82a6 100644
--- a/application/Espo/Core/Acl/Events/UserRoleUpdate.php
+++ b/application/Espo/Core/Acl/Events/UserRoleUpdate.php
@@ -42,7 +42,7 @@ readonly class UserRoleUpdate implements CrossInstanceEvent
public string $userId,
) {}
- public static function fromRaw(stdClass $payload): self
+ public static function fromPayload(stdClass $payload): self
{
$userId = $payload->userId ?? null;
@@ -55,7 +55,7 @@ readonly class UserRoleUpdate implements CrossInstanceEvent
);
}
- public function toRaw(): stdClass
+ public function toPayload(): stdClass
{
return (object) [
'userId' => $this->userId,
diff --git a/application/Espo/Core/Portal/Acl/Events/PortalUserRoleUpdate.php b/application/Espo/Core/Portal/Acl/Events/PortalUserRoleUpdate.php
index 69b9250679..49355e3704 100644
--- a/application/Espo/Core/Portal/Acl/Events/PortalUserRoleUpdate.php
+++ b/application/Espo/Core/Portal/Acl/Events/PortalUserRoleUpdate.php
@@ -43,7 +43,7 @@ class PortalUserRoleUpdate implements CrossInstanceEvent
public string $portalId,
) {}
- public static function fromRaw(stdClass $payload): self
+ public static function fromPayload(stdClass $payload): self
{
$userId = $payload->userId ?? null;
@@ -63,7 +63,7 @@ class PortalUserRoleUpdate implements CrossInstanceEvent
);
}
- public function toRaw(): stdClass
+ public function toPayload(): stdClass
{
return (object) [
'userId' => $this->userId,
diff --git a/application/Espo/Core/Utils/Event/CrossInstanceEvent.php b/application/Espo/Core/Utils/Event/CrossInstanceEvent.php
index a81edb4a82..9a803dcea8 100644
--- a/application/Espo/Core/Utils/Event/CrossInstanceEvent.php
+++ b/application/Espo/Core/Utils/Event/CrossInstanceEvent.php
@@ -33,7 +33,7 @@ use stdClass;
interface CrossInstanceEvent extends Event
{
- public static function fromRaw(stdClass $payload): self;
+ public static function fromPayload(stdClass $payload): self;
- public function toRaw(): stdClass;
+ public function toPayload(): stdClass;
}
diff --git a/application/Espo/Core/Utils/Event/CrossInstanceEventDispatcher.php b/application/Espo/Core/Utils/Event/CrossInstanceEventDispatcher.php
index 3b81b03953..44aab6c551 100644
--- a/application/Espo/Core/Utils/Event/CrossInstanceEventDispatcher.php
+++ b/application/Espo/Core/Utils/Event/CrossInstanceEventDispatcher.php
@@ -84,7 +84,7 @@ class CrossInstanceEventDispatcher
{
$envelope = new Envelope(
eventClassName: $event::class,
- payload: $event->toRaw(),
+ payload: $event->toPayload(),
origin: $this->originProvider->get(),
);
@@ -121,7 +121,7 @@ class CrossInstanceEventDispatcher
}
try {
- $event = $className::fromRaw($envelope->payload);
+ $event = $className::fromPayload($envelope->payload);
} catch (Throwable $e) {
throw new RuntimeException("Could not hydrate event '$className'.", previous: $e);
}
diff --git a/application/Espo/Core/Webhook/Events/UpdateGlobal.php b/application/Espo/Core/Webhook/Events/UpdateGlobal.php
index 206fe6a381..a5e79309b1 100644
--- a/application/Espo/Core/Webhook/Events/UpdateGlobal.php
+++ b/application/Espo/Core/Webhook/Events/UpdateGlobal.php
@@ -34,12 +34,12 @@ use stdClass;
class UpdateGlobal implements CrossInstanceEvent
{
- public static function fromRaw(stdClass $payload): CrossInstanceEvent
+ public static function fromPayload(stdClass $payload): CrossInstanceEvent
{
return new self();
}
- public function toRaw(): stdClass
+ public function toPayload(): stdClass
{
return (object) [];
}
diff --git a/application/Espo/Tools/Currency/Events/CurrencyRateUpdate.php b/application/Espo/Tools/Currency/Events/CurrencyRateUpdate.php
index 6602789ee3..b8b55b39bf 100644
--- a/application/Espo/Tools/Currency/Events/CurrencyRateUpdate.php
+++ b/application/Espo/Tools/Currency/Events/CurrencyRateUpdate.php
@@ -37,12 +37,12 @@ use stdClass;
*/
readonly class CurrencyRateUpdate implements CrossInstanceEvent
{
- public function toRaw(): stdClass
+ public function toPayload(): stdClass
{
return (object) [];
}
- public static function fromRaw(stdClass $payload): self
+ public static function fromPayload(stdClass $payload): self
{
return new self();
}
diff --git a/application/Espo/Tools/Pipeline/Events/UpdateGlobal.php b/application/Espo/Tools/Pipeline/Events/UpdateGlobal.php
index 9d47976188..2449944ecb 100644
--- a/application/Espo/Tools/Pipeline/Events/UpdateGlobal.php
+++ b/application/Espo/Tools/Pipeline/Events/UpdateGlobal.php
@@ -34,12 +34,12 @@ use stdClass;
class UpdateGlobal implements CrossInstanceEvent
{
- public static function fromRaw(stdClass $payload): CrossInstanceEvent
+ public static function fromPayload(stdClass $payload): CrossInstanceEvent
{
return new self();
}
- public function toRaw(): stdClass
+ public function toPayload(): stdClass
{
return (object) [];
}
diff --git a/tests/unit/Espo/Core/Utils/Event/TestCiEvent1.php b/tests/unit/Espo/Core/Utils/Event/TestCiEvent1.php
index 88b47fb1d9..974455b010 100644
--- a/tests/unit/Espo/Core/Utils/Event/TestCiEvent1.php
+++ b/tests/unit/Espo/Core/Utils/Event/TestCiEvent1.php
@@ -38,12 +38,12 @@ class TestCiEvent1 implements CrossInstanceEvent
public string $value,
) {}
- public static function fromRaw(stdClass $payload): self
+ public static function fromPayload(stdClass $payload): self
{
return new self($payload->value ?? '');
}
- public function toRaw(): stdClass
+ public function toPayload(): stdClass
{
return (object) [
'value' => $this->value,
diff --git a/tests/unit/Espo/Core/Utils/Event/TestCiEvent2.php b/tests/unit/Espo/Core/Utils/Event/TestCiEvent2.php
index 40a2b58c0f..c7683d9fd1 100644
--- a/tests/unit/Espo/Core/Utils/Event/TestCiEvent2.php
+++ b/tests/unit/Espo/Core/Utils/Event/TestCiEvent2.php
@@ -34,12 +34,12 @@ use stdClass;
class TestCiEvent2 implements CrossInstanceEvent
{
- public static function fromRaw(stdClass $payload): self
+ public static function fromPayload(stdClass $payload): self
{
return new self();
}
- public function toRaw(): stdClass
+ public function toPayload(): stdClass
{
return (object) [];
}