Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 594 Bytes

LazyDenormalizationObjectMapping.md

File metadata and controls

28 lines (20 loc) · 594 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('');
// array<int, DenormalizationFieldMappingInterface>