| @@ 139-149 (lines=11) @@ | ||
| 136 | if (!empty($this->contactId)) { |
|
| 137 | $result['contact_id'] = $this->contactId; |
|
| 138 | } |
|
| 139 | if (!empty($this->contact)) { |
|
| 140 | if ($toSave) { |
|
| 141 | if (!empty($this->contact->getId())) { |
|
| 142 | $result['contact_id'] = $this->contact->getId(); |
|
| 143 | } else { |
|
| 144 | $result['contact'] = $this->contact->toArray(); |
|
| 145 | } |
|
| 146 | } else { |
|
| 147 | $result['contact'] = $this->contact->toArray(); |
|
| 148 | } |
|
| 149 | } |
|
| 150 | if (!empty($this->id)) { |
|
| 151 | $result['id'] = $this->getId(); |
|
| 152 | } |
|
| @@ 170-180 (lines=11) @@ | ||
| 167 | if (!empty($this->viewId)) { |
|
| 168 | $result['view_id'] = $this->viewId; |
|
| 169 | } |
|
| 170 | if (!empty($this->view)) { |
|
| 171 | if ($toSave) { |
|
| 172 | if (!empty($this->view->getId())) { |
|
| 173 | $result['view_id'] = $this->view->getId(); |
|
| 174 | } else { |
|
| 175 | $result['view'] = $this->view->toArray(); |
|
| 176 | } |
|
| 177 | } else { |
|
| 178 | $result['view'] = $this->view->toArray(); |
|
| 179 | } |
|
| 180 | } |
|
| 181 | foreach ($this->getPayments() as $payment) { |
|
| 182 | $result['payments'][] = $payment->toArray(); |
|
| 183 | } |
|