1 | <?php |
||
13 | final class TestPhone implements AssemblableInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $name; |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private $version; |
||
23 | |||
24 | /** |
||
25 | * @param string $name |
||
26 | */ |
||
27 | public function setName(string $name) |
||
28 | { |
||
29 | $this->name = $name; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string $value |
||
34 | */ |
||
35 | public function setValue(string $value) |
||
36 | { |
||
37 | $this->version = $value; |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | public function getName(): string |
||
44 | { |
||
45 | return $this->name; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | public function getValue(): string |
||
52 | { |
||
53 | return $this->version; |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return XmlElement |
||
58 | */ |
||
59 | public function assemble(): XmlElement |
||
60 | { |
||
61 | $element = new XmlElement('phone', $this->version); |
||
62 | $element->setAttribute(new Attribute('name', $this->name)); |
||
63 | |||
64 | return $element; |
||
65 | } |
||
66 | } |