1 | <?php |
||
5 | class AttachmentField |
||
6 | { |
||
7 | /** |
||
8 | * The required title field of the field. |
||
9 | * |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $title; |
||
13 | |||
14 | /** |
||
15 | * The required value of the field. |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $value; |
||
20 | |||
21 | /** |
||
22 | * Whether the value is short enough to fit side by side with |
||
23 | * other values. |
||
24 | * |
||
25 | * @var bool |
||
26 | */ |
||
27 | protected $short = false; |
||
28 | |||
29 | public static function create(array $attributes) |
||
33 | |||
34 | /** |
||
35 | * @param array $attributes |
||
36 | */ |
||
37 | public function __construct(array $attributes) |
||
51 | |||
52 | /** |
||
53 | * Get the title of the field. |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getTitle(): string |
||
61 | |||
62 | /** |
||
63 | * Set the title of the field. |
||
64 | * |
||
65 | * @param string $title |
||
66 | * |
||
67 | * @return $this |
||
68 | */ |
||
69 | public function setTitle(string $title) |
||
75 | |||
76 | /** |
||
77 | * Get the value of the field. |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getValue(): string |
||
85 | |||
86 | /** |
||
87 | * Set the value of the field. |
||
88 | * |
||
89 | * @param string $value |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function setValue(string $value) |
||
98 | |||
99 | /** |
||
100 | * Get whether this field is short enough for displaying |
||
101 | * side-by-side with other fields. |
||
102 | * |
||
103 | * @return bool |
||
104 | */ |
||
105 | public function getShort(): bool |
||
109 | |||
110 | /** |
||
111 | * Set whether this field is short enough for displaying |
||
112 | * side-by-side with other fields. |
||
113 | * |
||
114 | * @param bool $value |
||
115 | * |
||
116 | * @return $this |
||
117 | */ |
||
118 | public function setShort(bool $value) |
||
124 | |||
125 | /** |
||
126 | * Get the array representation of this attachment field. |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | public function toArray(): array |
||
138 | } |