forked from acquia/mc-cs-plugin-custom-objects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Token.php
133 lines (107 loc) · 2.32 KB
/
Token.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?php
declare(strict_types=1);
namespace MauticPlugin\CustomObjectsBundle\DTO;
/**
* Object that represents parsed token like this one:.
*
* {custom-object=product:sku | where=segment-filter |order=latest|limit=1 | default=Nothing to see here | format=or-list}
*/
class Token
{
/**
* @var string
*/
private $token;
/**
* @var int
*/
private $limit = 1;
/**
* @var string
*/
private $where = '';
/**
* @var string
*/
private $order = 'latest';
/**
* @var string
*/
private $defaultValue = '';
/**
* @var string
*/
private $format = '';
/**
* @var string
*/
private $customFieldAlias = '';
/**
* @var string
*/
private $customObjectAlias = '';
public function __construct(string $token)
{
$this->token = $token;
}
public function setDefaultValue(string $defaultValue): void
{
$this->defaultValue = $defaultValue;
}
public function getDefaultValue(): string
{
return $this->defaultValue;
}
public function getOrder(): string
{
return $this->order;
}
public function setOrder(string $order): void
{
$this->order = $order;
}
public function getWhere(): string
{
return $this->where;
}
public function setWhere(string $where): void
{
$this->where = $where;
}
public function getFormat(): string
{
return $this->format;
}
public function setFormat(string $format): void
{
$this->format = $format;
}
public function getLimit(): int
{
return $this->limit;
}
public function setLimit(int $limit): void
{
$this->limit = $limit;
}
public function getToken(): string
{
return $this->token;
}
public function getCustomFieldAlias(): string
{
return $this->customFieldAlias;
}
public function setCustomFieldAlias(string $customFieldAlias): void
{
$this->customFieldAlias = $customFieldAlias;
}
public function getCustomObjectAlias(): string
{
return $this->customObjectAlias;
}
public function setCustomObjectAlias(string $customObjectAlias): void
{
$this->customObjectAlias = $customObjectAlias;
}
}