Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 601 Bytes

DenormalizationFieldMappingFactory.md

File metadata and controls

29 lines (22 loc) · 601 Bytes

DenormalizationFieldMappingFactory

<?php

use Chubbyphp\Deserialization\Accessor\PropertyAccessor;
use Chubbyphp\Deserialization\Denormalizer\FieldDenormalizer;
use Chubbyphp\Deserialization\Mapping\DenormalizationFieldMappingFactory;

$factory = new DenormalizationFieldMappingFactory();

$fieldMapping = $factory->create(
    'name',
    false,
    new FieldDenormalizer(
        new PropertyAccessor('name')
    )
);

echo $fieldMapping->getName();
// 'name'

print_r($fieldMapping->getGroups());
// ['group1']

$fieldMapping
    ->getFieldDenormalizer()
    ->denormalizeField(...);