@@ 109-121 (lines=13) @@ | ||
106 | /** |
|
107 | * @return array |
|
108 | */ |
|
109 | public function toArray() |
|
110 | { |
|
111 | $result = [ |
|
112 | 'type' => $this->type, |
|
113 | 'data' => $this->data |
|
114 | ]; |
|
115 | ||
116 | if ( ! empty($this->id)) { |
|
117 | $result['id'] = $this->getId(); |
|
118 | } |
|
119 | ||
120 | return $result; |
|
121 | } |
|
122 | ||
123 | ||
124 | /** |
@@ 110-123 (lines=14) @@ | ||
107 | /** |
|
108 | * @return array |
|
109 | */ |
|
110 | public function toArray() |
|
111 | { |
|
112 | $result = [ |
|
113 | 'id' => $this->id, |
|
114 | 'name' => $this->name, |
|
115 | 'type' => $this->type |
|
116 | ]; |
|
117 | ||
118 | if ( ! empty($this->value)) { |
|
119 | $result['value'] = $this->getValue(); |
|
120 | } |
|
121 | ||
122 | return $result; |
|
123 | } |
|
124 | ||
125 | ||
126 | /** |