|
@@ 66-68 (lines=3) @@
|
| 63 |
|
if (isset($row['currency']) && isset($row['price']['amount'])) { |
| 64 |
|
$row['price'] = new Money($row['price']['amount'], $row['currency']); |
| 65 |
|
} |
| 66 |
|
if (isset($row['data'])) { |
| 67 |
|
$data = is_array($row['data']) ? $row['data'] : Json::decode($row['data']); |
| 68 |
|
} |
| 69 |
|
if (isset($data['formula'])) { |
| 70 |
|
$row['formula'] = $this->hydrator->hydrate([$data['formula']], FormulaInterface::class); |
| 71 |
|
} |
|
@@ 101-103 (lines=3) @@
|
| 98 |
|
*/ |
| 99 |
|
public function createEmptyInstance(string $className, array $data = []) |
| 100 |
|
{ |
| 101 |
|
if (isset($data['data']) && !is_array($data['data'])) { |
| 102 |
|
$additionalData = Json::decode($data['data']); |
| 103 |
|
} |
| 104 |
|
|
| 105 |
|
$className = $this->priceFactory->findClassForTypes([ |
| 106 |
|
$additionalData['class'] ?? null, |