mirror of
https://github.com/ToxicCrack/PrintABrick.git
synced 2025-05-18 05:10:07 -07:00
24 lines
573 B
PHP
24 lines
573 B
PHP
<?php
|
|
|
|
namespace AppBundle\Api\Client\Rebrickable\Converter;
|
|
|
|
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
|
|
|
|
class PartPropertyNameConverter implements NameConverterInterface
|
|
{
|
|
public function normalize($propertyName)
|
|
{
|
|
return $propertyName;
|
|
}
|
|
|
|
public function denormalize($propertyName)
|
|
{
|
|
switch ($propertyName) {
|
|
case 'part_name': return 'name';
|
|
case 'part_id': return 'id';
|
|
case 'part_type_id': return 'typeId';
|
|
default: return $propertyName;
|
|
}
|
|
}
|
|
}
|