@@ -149,7 +149,7 @@ Attributes Groups
149
149
Sometimes, you want to serialize different set of attributes from your
150
150
entities. Groups are a handy way to achieve this need.
151
151
152
- Lets start with a simple Plain Old PHP object.
152
+ Lets start with a simple Plain Old PHP object::
153
153
154
154
namespace Acme;
155
155
@@ -164,21 +164,21 @@ and YAML. The :class:Symfony\Component\Serializer\Mapping\Factory\ClassMetadataF
164
164
that will be used by the normalizer must be aware of the format to use.
165
165
166
166
If you want to use annotations to define groups, initialize the :class: Symfony\C omponent\S erializer\M apping\F actory\C lassMetadataFactory
167
- like the following:
167
+ like the following::
168
168
169
169
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
170
170
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
171
171
172
172
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
173
173
174
- If you prefer XML:
174
+ If you prefer XML::
175
175
176
176
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
177
177
use Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader;
178
178
179
179
$classMetadataFactory = new ClassMetadataFactory(new XmlFileLoader('/path/to/your/definition.xml'));
180
180
181
- And for YAML:
181
+ And for YAML::
182
182
183
183
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
184
184
use Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader;
@@ -234,7 +234,7 @@ Then, create your groups definition:
234
234
</class >
235
235
</serializer >
236
236
237
- You are now able to serialize only attributes in the groups you want:
237
+ You are now able to serialize only attributes in the groups you want::
238
238
239
239
use Symfony\Component\Serializer\Serializer;
240
240
use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
0 commit comments