Store run subjects in extra table

[MAILPOET-4966]
This commit is contained in:
David Remer
2023-02-15 08:44:17 +02:00
committed by Aschepikov
parent d406e7c05e
commit c4faa53386
6 changed files with 152 additions and 21 deletions

View File

@@ -2,6 +2,8 @@
namespace MailPoet\Automation\Engine\Data;
use MailPoet\Automation\Engine\Utils\Json;
class Subject {
/** @var string */
private $key;
@@ -28,11 +30,11 @@ class Subject {
public function toArray(): array {
return [
'key' => $this->getKey(),
'args' => $this->getArgs(),
'args' => Json::encode($this->getArgs()),
];
}
public static function fromArray(array $data): self {
return new self($data['key'], $data['args']);
return new self($data['key'], Json::decode($data['args']));
}
}