| @@ 18-32 (lines=15) @@ | ||
| 15 | * |
|
| 16 | * @author Andrii Vasyliev <[email protected]> |
|
| 17 | */ |
|
| 18 | class EnumPriceHydrator extends PriceHydrator |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * {@inheritdoc} |
|
| 22 | * @param object|Plan $object |
|
| 23 | */ |
|
| 24 | public function extract($object) |
|
| 25 | { |
|
| 26 | return array_merge(parent::extract($object), array_filter([ |
|
| 27 | 'unit' => $this->hydrator->extract($object->getUnit()), |
|
| 28 | 'currency' => $this->hydrator->extract($object->getCurrency()), |
|
| 29 | 'sums' => $sums, |
|
| 30 | ])); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 18-31 (lines=14) @@ | ||
| 15 | * |
|
| 16 | * @author Andrii Vasyliev <[email protected]> |
|
| 17 | */ |
|
| 18 | class SinglePriceHydrator extends PriceHydrator |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * {@inheritdoc} |
|
| 22 | * @param object|Plan $object |
|
| 23 | */ |
|
| 24 | public function extract($object) |
|
| 25 | { |
|
| 26 | return array_merge(parent::extract($object), array_filter([ |
|
| 27 | 'prepaid' => $this->hydrator->extract($object->getPrepaid()), |
|
| 28 | 'price' => $this->hydrator->extract($object->getPrice()), |
|
| 29 | ])); |
|
| 30 | } |
|
| 31 | } |
|
| 32 | ||