| @@ 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 | /** |
|
| @@ 106-119 (lines=14) @@ | ||
| 103 | /** |
|
| 104 | * @return array |
|
| 105 | */ |
|
| 106 | public function toArray() |
|
| 107 | { |
|
| 108 | $result = [ |
|
| 109 | 'id' => $this->id, |
|
| 110 | 'name' => $this->name, |
|
| 111 | 'type' => $this->type |
|
| 112 | ]; |
|
| 113 | ||
| 114 | if ( ! empty($this->value)) { |
|
| 115 | $result['value'] = $this->getValue(); |
|
| 116 | } |
|
| 117 | ||
| 118 | return $result; |
|
| 119 | } |
|
| 120 | ||
| 121 | ||
| 122 | /** |
|