for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Waredesk\Mappers\Product\Variant;
use DateTime;
use Waredesk\Models\Product\Variant\Option;
use Waredesk\Models\Product\Variant\Price;
class PriceMapper
{
public function map(Price $price, $data): Price
foreach ($data as $key => $value) {
switch ($key) {
case 'id':
$price->setId((int)$value);
break;
case 'price_list_id':
$price->setPriceListId((int)$value);
case 'currency':
$price->setCurrency($value);
case 'price':
$price->setPrice((int)$value);
case 'creation_datetime':
$price->setCreationDatetime(new DateTime($value));
case 'modification_datetime':
$price->setModificationDatetime(new DateTime($value));
}
return $price;