@@ 24-35 (lines=12) @@ | ||
21 | */ |
|
22 | protected $color; |
|
23 | ||
24 | public function __construct(array $categoryData = []) |
|
25 | { |
|
26 | if (isset($categoryData['id'])) { |
|
27 | $this->id = (int) $categoryData['id']; |
|
28 | } |
|
29 | if (!empty($categoryData['category'])) { |
|
30 | $this->name = $categoryData['category']; |
|
31 | } |
|
32 | if (!empty($categoryData['purpose'])) { |
|
33 | $this->color = $categoryData['purpose']; |
|
34 | } |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * @return array |
@@ 24-35 (lines=12) @@ | ||
21 | */ |
|
22 | protected $sum; |
|
23 | ||
24 | public function __construct(array $paymentData = []) |
|
25 | { |
|
26 | if (!empty($paymentData['category'])) { |
|
27 | $this->category = $paymentData['category']; |
|
28 | } |
|
29 | if (!empty($paymentData['purpose'])) { |
|
30 | $this->purpose = $paymentData['purpose']; |
|
31 | } |
|
32 | if (!empty($paymentData['sum'])) { |
|
33 | $this->sum = $paymentData['sum']; |
|
34 | } |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * @return array |