| @@ 91-103 (lines=13) @@ | ||
| 88 | /** |
|
| 89 | * @return array |
|
| 90 | */ |
|
| 91 | public function toArray() |
|
| 92 | { |
|
| 93 | $result = [ |
|
| 94 | 'type' => $this->type, |
|
| 95 | 'data' => $this->data, |
|
| 96 | ]; |
|
| 97 | ||
| 98 | if (!empty($this->id)) { |
|
| 99 | $result['id'] = $this->getId(); |
|
| 100 | } |
|
| 101 | return $result; |
|
| 102 | } |
|
| 103 | ||
| 104 | /** |
|
| 105 | * @return int |
|
| 106 | */ |
|
| @@ 87-100 (lines=14) @@ | ||
| 84 | /** |
|
| 85 | * @return array |
|
| 86 | */ |
|
| 87 | public function toArray() |
|
| 88 | { |
|
| 89 | $result = [ |
|
| 90 | 'id' => $this->id, |
|
| 91 | 'name' => $this->name, |
|
| 92 | 'type' => $this->type, |
|
| 93 | ]; |
|
| 94 | if (!empty($this->value)) { |
|
| 95 | $result['value'] = $this->getValue(); |
|
| 96 | } |
|
| 97 | return $result; |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * @return int |
|
| 102 | */ |
|
| 103 | public function getId() |
|
| @@ 60-69 (lines=10) @@ | ||
| 57 | /** |
|
| 58 | * @return array |
|
| 59 | */ |
|
| 60 | public function toArray() |
|
| 61 | { |
|
| 62 | $result = [ |
|
| 63 | 'id' => $this->id, |
|
| 64 | 'type' => $this->type, |
|
| 65 | 'name' => $this->name, |
|
| 66 | 'value' => $this->value, |
|
| 67 | ]; |
|
| 68 | return $result; |
|
| 69 | } |
|
| 70 | ||
| 71 | /** |
|
| 72 | * @return bool |
|