1XML Reference
2-------------
3::
4
5    <!-- MyBundle\Resources\config\serializer\Fully.Qualified.ClassName.xml -->
6    <?xml version="1.0" encoding="UTF-8" ?>
7    <serializer>
8        <class name="Fully\Qualified\ClassName" exclusion-policy="ALL" xml-root-name="foo-bar" exclude="true"
9            accessor-order="custom" custom-accessor-order="propertyName1,propertyName2,...,propertyNameN"
10            access-type="public_method" discriminator-field-name="type" discriminator-disabled="false" read-only="false">
11            <xml-namespace prefix="atom" uri="http://www.w3.org/2005/Atom"/>
12            <xml-discriminator attribute="true" cdata="false" namespace=""/>
13            <discriminator-class value="some-value">ClassName</discriminator-class>
14            <discriminator-groups>
15                <group>foo</group>
16            </discriminator-groups>
17            <property name="some-property"
18                      exclude="true"
19                      expose="true"
20                      exclude-if="expr"
21                      expose-if="expr"
22                      skip-when-empty="false"
23                      type="string"
24                      serialized-name="foo"
25                      since-version="1.0"
26                      until-version="1.1"
27                      xml-attribute="true"
28                      xml-value="true"
29                      access-type="public_method"
30                      accessor-getter="getSomeProperty"
31                      accessor-setter="setSomeProperty"
32                      inline="true"
33                      read-only="true"
34                      groups="foo,bar"
35                      xml-key-value-pairs="true"
36                      xml-attribute-map="true"
37                      max-depth="2"
38            >
39                <!-- You can also specify the type as element which is necessary if
40                     your type contains "<" or ">" characters. -->
41                <type><![CDATA[]]></type>
42                <xml-list inline="true" entry-name="foobar" namespace="http://www.w3.org/2005/Atom" skip-when-empty="true" />
43                <xml-map inline="true" key-attribute-name="foo" entry-name="bar" namespace="http://www.w3.org/2005/Atom" />
44                <xml-element cdata="false" namespace="http://www.w3.org/2005/Atom"/>
45                <groups>
46                    <value>foo</value>
47                    <value>bar</value>
48                </groups>
49            </property>
50            <callback-method name="foo" type="pre-serialize" />
51            <callback-method name="bar" type="post-serialize" />
52            <callback-method name="baz" type="post-deserialize" />
53
54            <virtual-property method="public_method"
55                      name="some-property"
56                      exclude="true"
57                      expose="true"
58                      skip-when-empty="false"
59                      type="string"
60                      serialized-name="foo"
61                      since-version="1.0"
62                      until-version="1.1"
63                      xml-attribute="true"
64                      access-type="public_method"
65                      accessor-getter="getSomeProperty"
66                      accessor-setter="setSomeProperty"
67                      inline="true"
68                      read-only="true"
69                      groups="foo,bar"
70                      xml-key-value-pairs="true"
71                      xml-attribute-map="true"
72                      max-depth="2"
73            >
74            <virtual-property expression="object.getName()"
75                      name="some-property"
76                      exclude="true"
77                      expose="true"
78                      type="string"
79                      serialized-name="foo"
80                      since-version="1.0"
81                      until-version="1.1"
82                      xml-attribute="true"
83                      access-type="public_method"
84                      accessor-getter="getSomeProperty"
85                      accessor-setter="setSomeProperty"
86                      inline="true"
87                      read-only="true"
88                      groups="foo,bar"
89                      xml-key-value-pairs="true"
90                      xml-attribute-map="true"
91                      max-depth="2"
92            >
93                <!-- You can also specify the type as element which is necessary if
94                     your type contains "<" or ">" characters. -->
95                <type><![CDATA[]]></type>
96                <groups>
97                    <value>foo</value>
98                    <value>bar</value>
99                </groups>
100                <xml-list inline="true" entry-name="foobar" namespace="http://www.w3.org/2005/Atom" skip-when-empty="true" />
101                <xml-map inline="true" key-attribute-name="foo" entry-name="bar" namespace="http://www.w3.org/2005/Atom" />
102            </virtual-property>
103
104        </class>
105    </serializer>
106