From 50b889a1bd3aa127f788478ba88921123d0b2d54 Mon Sep 17 00:00:00 2001 From: Jan Jakes Date: Mon, 7 Mar 2022 14:53:27 +0100 Subject: [PATCH] Add workflow data subject & field interfaces A subject contains multiple fields. Each field has a type and they can be filtered and used later on. [MAILPOET-4136] --- .../lib/Automation/Engine/Workflows/Field.php | 60 +++++++++++++++++++ .../Automation/Engine/Workflows/Subject.php | 14 +++++ 2 files changed, 74 insertions(+) create mode 100644 mailpoet/lib/Automation/Engine/Workflows/Field.php create mode 100644 mailpoet/lib/Automation/Engine/Workflows/Subject.php diff --git a/mailpoet/lib/Automation/Engine/Workflows/Field.php b/mailpoet/lib/Automation/Engine/Workflows/Field.php new file mode 100644 index 0000000000..72c6cd1909 --- /dev/null +++ b/mailpoet/lib/Automation/Engine/Workflows/Field.php @@ -0,0 +1,60 @@ +key = $key; + $this->type = $type; + $this->name = $name; + $this->factory = $factory; + $this->args = $args; + } + + public function getKey(): string { + return $this->key; + } + + public function getType(): string { + return $this->type; + } + + public function getName(): string { + return $this->name; + } + + public function getFactory(): callable { + return $this->factory; + } + + public function getArgs(): array { + return $this->args; + } +} diff --git a/mailpoet/lib/Automation/Engine/Workflows/Subject.php b/mailpoet/lib/Automation/Engine/Workflows/Subject.php new file mode 100644 index 0000000000..2084f6d1bf --- /dev/null +++ b/mailpoet/lib/Automation/Engine/Workflows/Subject.php @@ -0,0 +1,14 @@ + */ + public function getFields(): array; + + public function load(array $args): void; + + public function pack(): array; +}