first commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace KupShop\UserAddressesBundle\Util;
|
||||
|
||||
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
|
||||
|
||||
class DeliveryAddressConverter implements NameConverterInterface
|
||||
{
|
||||
public function normalize(string $propertyName): string
|
||||
{
|
||||
if (in_array($propertyName, ['id', 'id_user'])) {
|
||||
return $propertyName;
|
||||
}
|
||||
|
||||
return 'delivery_'.$propertyName;
|
||||
}
|
||||
|
||||
public function denormalize(string $propertyName): string
|
||||
{
|
||||
return str_replace('delivery_', '', $propertyName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user