Total Complexity | 5 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | class Input implements DmnConvertibleInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $label; |
||
15 | |||
16 | /** |
||
17 | * @var string |
||
18 | */ |
||
19 | private $name; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $type; |
||
25 | |||
26 | /** |
||
27 | * Input constructor. |
||
28 | * @param string $label |
||
29 | * @param string $name |
||
30 | * @param string $type |
||
31 | */ |
||
32 | public function __construct($label, $name, $type) |
||
33 | { |
||
34 | $this->label = $label; |
||
35 | $this->name = $name; |
||
36 | $this->type = $type; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Returns an XML representation of an input. |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | public function toDMN() |
||
45 | { |
||
46 | return |
||
47 | '<input id="' . uniqid('input') . '" label="' . $this->label . '">' . |
||
48 | '<inputExpression id="' . uniqid('inputExpression') . '" typeRef="' . $this->type . '">' . |
||
49 | '<text>' . $this->name . '</text>' . |
||
50 | '</inputExpression>' . |
||
51 | '</input>'; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | public function getLabel() |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getName() |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | public function getType() |
||
76 | } |
||
77 | } |