1 | <?php |
||
19 | class XmlWithProtectedField implements XmlConvertibleInterface |
||
20 | { |
||
21 | use XmlConvertible; |
||
22 | |||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $protectedField; |
||
27 | |||
28 | /** |
||
29 | * XmlWithProtectedField constructor. |
||
30 | * @param string $protectedFieldValue |
||
31 | */ |
||
32 | public function __construct(string $protectedFieldValue) |
||
33 | { |
||
34 | $this->setProtectedField($protectedFieldValue); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return string |
||
39 | */ |
||
40 | public function getProtectedField(): string |
||
41 | { |
||
42 | return $this->protectedField; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @param string $newValue |
||
47 | * @return $this |
||
48 | */ |
||
49 | public function setProtectedField(string $newValue) |
||
50 | { |
||
51 | $this->protectedField = $newValue; |
||
52 | return $this; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @param array|null $properties |
||
57 | * @return array |
||
58 | */ |
||
59 | public function getXmlProperties(?array $properties = null): array |
||
60 | { |
||
61 | return ['protectedField']; |
||
62 | } |
||
63 | } |
||
64 |