Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 659 Bytes

CallableNormalizationObjectMapping.md

File metadata and controls

28 lines (21 loc) · 659 Bytes

CallableNormalizationObjectMapping

<?php

use Chubbyphp\Serialization\Mapping\CallableNormalizationObjectMapping;
use MyProject\Mapping\ModelMapping;
use MyProject\Model\Model;

$objectMapping = new CallableNormalizationObjectMapping(
    Model::class,
    function () {
        return new ModelMapping();
    }
);

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

echo $objectMapping->getNormalizationType();
// 'model'

$objectMapping->getNormalizationFieldMappings('');
// array<int, NormalizationFieldMappingInterface>

$objectMapping->getNormalizationEmbeddedFieldMappings('');
// array<int, NormalizationFieldMappingInterface>