| 1 | <?php |
||
| 13 | final class TestCar implements AssemblableInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private $marke; |
||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | public $kennung; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @param string $marke |
||
| 26 | */ |
||
| 27 | public function setMarke(string $marke) |
||
| 28 | { |
||
| 29 | $this->marke = $marke; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return string |
||
| 34 | */ |
||
| 35 | public function getMarke(): string |
||
| 36 | { |
||
| 37 | return $this->marke; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return XmlElement |
||
| 42 | */ |
||
| 43 | public function assemble(): XmlElement |
||
| 44 | { |
||
| 45 | $element = new XmlElement('car'); |
||
| 46 | $element->setAttribute(new Attribute('marke', $this->marke)); |
||
| 47 | $element->setAttribute(new Attribute('kennung', $this->kennung)); |
||
| 48 | |||
| 49 | return $element; |
||
| 50 | } |
||
| 51 | } |