| @@ 40-53 (lines=14) @@ | ||
| 37 | /** |
|
| 38 | * @return array |
|
| 39 | */ |
|
| 40 | public function toArray() |
|
| 41 | { |
|
| 42 | $result = []; |
|
| 43 | if (!empty($this->id)) { |
|
| 44 | $result['id'] = $this->getId(); |
|
| 45 | } |
|
| 46 | if (!empty($this->name)) { |
|
| 47 | $result['category'] = $this->getName(); |
|
| 48 | } |
|
| 49 | if (!empty($this->color)) { |
|
| 50 | $result['purpose'] = $this->getColor(); |
|
| 51 | } |
|
| 52 | return $result; |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @return bool |
|
| @@ 40-53 (lines=14) @@ | ||
| 37 | /** |
|
| 38 | * @return array |
|
| 39 | */ |
|
| 40 | public function toArray() |
|
| 41 | { |
|
| 42 | $result = []; |
|
| 43 | if (!empty($this->category)) { |
|
| 44 | $result['category'] = $this->getCategory(); |
|
| 45 | } |
|
| 46 | if (!empty($this->purpose)) { |
|
| 47 | $result['purpose'] = $this->getPurpose(); |
|
| 48 | } |
|
| 49 | if (!empty($this->sum)) { |
|
| 50 | $result['sum'] = $this->getSum(); |
|
| 51 | } |
|
| 52 | return $result; |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @return bool |
|