<?php declare(strict_types = 1); namespace MailPoet\Automation\Engine\Data; if (!defined('ABSPATH')) exit; use MailPoet\Automation\Engine\Integration\Payload; class Field { public const TYPE_BOOLEAN = 'boolean'; public const TYPE_INTEGER = 'integer'; public const TYPE_NUMBER = 'number'; public const TYPE_STRING = 'string'; public const TYPE_ENUM = 'enum'; public const TYPE_ENUM_ARRAY = 'enum_array'; public const TYPE_DATETIME = 'datetime'; /** @var string */ private $key; /** @var string */ private $type; /** @var string */ private $name; /** @var callable */ private $factory; /** @var array */ private $args; public function __construct( string $key, string $type, string $name, callable $factory, array $args = [] ) { $this->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; } /** @return mixed */ public function getValue(Payload $payload, array $params = []) { return $this->getFactory()($payload, $params); } public function getArgs(): array { return $this->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 |
|