Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 378 Bytes

FieldNormalizer.md

File metadata and controls

23 lines (18 loc) · 378 Bytes

FieldNormalizer

<?php

use Chubbyphp\Serialization\Accessor\PropertyAccessor;
use Chubbyphp\Serialization\Normalizer\FieldNormalizer;
use MyProject\Model\Model;

$model = new Model;
$context = ...;

$fieldNormalizer = new FieldNormalizer(
    new PropertyAccessor('name')
);

echo $fieldNormalizer->normalizeField(
    'name',
    $model,
    $context
);
// 'php'