@@ -3,14 +3,15 @@ Normalt
33
44[ ![ Build Status] ( https://travis-ci.org/bernardphp/normalt.png?branch=master )] ( https://travis-ci.org/bernardphp/normalt )
55
6- Normalt contains additional normalizer's for use with the serializer component found in Symfony. It also
6+ Normalt contains additional normalizers for use with the serializer component found in Symfony. It also
77implements a normalizer delegator that will look at the data you want normalized and/or denormalized
88and call the normalizer which supports it.
99
1010In the context of Normalt normalization is the act of converting an object into an array. Denormalization
1111is the opposite direction (converting array into an object). This is to my knowledge the same concept
1212Symfony serializer uses.
1313
14+
1415Table of Contents
1516-----------------
1617
@@ -28,14 +29,16 @@ Getting Started
2829Getting started is as easy as requiring the library with composer.
2930
3031``` bash
31- $ composer require bernard/normalt: ~ 0.1
32+ $ composer require bernard/normalt
3233```
3334
35+
3436Normalizers
3537-----------
3638
3739Theese normalizers can be used with the serializer component directly or through the ` AggregateNormalizer ` .
3840
41+
3942### AggregateNormalizer
4043
4144` AggregateNormalizer ` is a delegator and aggregator as it aggregates multiple normalizers and denormalizers
@@ -48,6 +51,7 @@ It implements a subset of the full serializer and its only focus is normalizing
4851denormalize arrays into objects. This lets you focus on normalization instead of converting
4952into a specific format such as ` xml ` , ` json ` etc.
5053
54+
5155#### Usage
5256
5357You need to instantiate the normalizer and the list of normalizer/denormalizers you want to use.
@@ -95,6 +99,7 @@ echo $user->getName(); // outputs Henrik
9599In contrast to the other normalizers in this package, it does __ not__ make sense to use this with the
96100serializer as the Serializer already does most of the functionality already.
97101
102+
98103### DoctrineNormalizer
99104
100105` DoctrineNormalizer ` normalizes mapped objects (Entities, Documents etc.) into arrays and back again.
@@ -117,6 +122,7 @@ $array = $normalizer->normalize($user);
117122$user = $normalizer->denormalize($array, null);
118123```
119124
125+
120126### RecursiveReflectionNormalizer
121127
122128This normalizes also delegates like the ` AggregateNormalizer ` , but delegates for each property in the object
@@ -144,8 +150,8 @@ $array = $normalizer->normalize($profile);
144150$profile = $normalize->denormalize($array, 'MyModel\Profile');
145151```
146152
153+
147154License
148155-------
149156
150157Please refer to the included ` LICENSE ` file.
151-
0 commit comments