Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 584 Bytes

LazyDenormalizationObjectMapping.md

File metadata and controls

28 lines (20 loc) · 584 Bytes

LazyDenormalizationObjectMapping

<?php

use Chubbyphp\Deserialization\Mapping\LazyDenormalizationObjectMapping;
use MyProject\Model\Model;

$container = ...;

$objectMapping = new LazyDenormalizationObjectMapping(
    $container,
    'myproject.denormalizer.mapping.model',
    Model::class
);

echo $objectMapping->getClass();
// 'MyProject\Model\Model'

$callable = $objectMapping->getFactory('');
$model = $callable();

echo get_class($model);
// 'MyProject\Model\Model'

$objectMapping->getDenormalizationFieldMappings('');
// DenormalizationFieldMappingInterface[]