<?php declare(strict_types = 1); namespace MailPoet\Automation\Engine\Data; if (!defined('ABSPATH')) exit; use MailPoet\Automation\Engine\Utils\Json; class Subject { /** @var string */ private $key; /** @var array */ private $args; public function __construct( string $key, array $args ) { $this->key = $key; $this->args = $args; } public function getKey(): string { return $this->key; } public function getArgs(): array { return $this->args; } public function getHash(): string { return md5($this->getKey() . serialize($this->getArgs())); } public function toArray(): array { return [ 'key' => $this->getKey(), 'args' => Json::encode($this->getArgs()), 'hash' => $this->getHash(), ]; } public static function fromArray(array $data): self { return new self($data['key'], Json::decode($data['args'])); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Automation.php | File | 6.27 KB | 0644 |
|
AutomationRun.php | File | 3.13 KB | 0644 |
|
AutomationRunLog.php | File | 5.2 KB | 0644 |
|
AutomationStatistics.php | File | 1.16 KB | 0644 |
|
AutomationTemplate.php | File | 2.09 KB | 0644 |
|
AutomationTemplateCategory.php | File | 486 B | 0644 |
|
Field.php | File | 1.38 KB | 0644 |
|
Filter.php | File | 1.39 KB | 0644 |
|
FilterGroup.php | File | 1.19 KB | 0644 |
|
Filters.php | File | 1.01 KB | 0644 |
|
NextStep.php | File | 498 B | 0644 |
|
Step.php | File | 2.4 KB | 0644 |
|
StepRunArgs.php | File | 4.44 KB | 0644 |
|
StepValidationArgs.php | File | 1.83 KB | 0644 |
|
Subject.php | File | 909 B | 0644 |
|
SubjectEntry.php | File | 1.26 KB | 0644 |
|
index.php | File | 6 B | 0644 |
|