1 | <?php |
||
24 | class EntityNormalizer extends AbstractSerializer implements NormalizerInterface |
||
25 | { |
||
26 | public function normalize($object, $format = null, array $context = []) |
||
59 | |||
60 | /** |
||
61 | * Normalizes the entity's fields |
||
62 | * |
||
63 | * @param array $fields |
||
64 | * @param FieldMetadataCollection $collection |
||
65 | * @param object $object |
||
66 | * @param array $data |
||
67 | */ |
||
68 | protected function normalizeFields(array $fields, FieldMetadataCollection $collection, $object, array &$data) |
||
77 | |||
78 | /** |
||
79 | * Normalizes the entity's embeddables |
||
80 | * |
||
81 | * @param array $embeddables |
||
82 | * @param FieldMetadataCollection $collection |
||
83 | * @param object $object |
||
84 | * @param array $data |
||
85 | */ |
||
86 | protected function normalizeEmbeddables(array $embeddables, FieldMetadataCollection $collection, $object, array &$data) |
||
98 | |||
99 | /** |
||
100 | * Normalizes the entity's associations |
||
101 | * |
||
102 | * @param array $associations |
||
103 | * @param AssociationMetadataCollection $collection |
||
104 | * @param object $object |
||
105 | * @param array $data |
||
106 | */ |
||
107 | protected function normalizeAssociations(array $associations, AssociationMetadataCollection $collection, $object, array &$data) |
||
119 | |||
120 | /** |
||
121 | * Checks whether the field is serializable |
||
122 | * |
||
123 | * @param string $fieldName |
||
124 | * @param FieldMetadataCollection $collection |
||
125 | * |
||
126 | * @return bool |
||
127 | */ |
||
128 | protected function isFieldSerializable(string $fieldName, FieldMetadataCollection $collection): bool |
||
138 | |||
139 | /** |
||
140 | * Checks whether the embeddable field is serializable |
||
141 | * |
||
142 | * @param string $embeddableName |
||
143 | * @param FieldMetadataCollection $collection |
||
144 | * |
||
145 | * @return bool |
||
146 | */ |
||
147 | protected function isEmbeddableSerializable(string $embeddableName, FieldMetadataCollection $collection): bool |
||
157 | |||
158 | /** |
||
159 | * Checks whether the association is serializable |
||
160 | * |
||
161 | * @param string $associationName |
||
162 | * @param AssociationMetadataCollection $collection |
||
163 | * |
||
164 | * @return bool |
||
165 | */ |
||
166 | protected function isAssociationSerializable(string $associationName, AssociationMetadataCollection $collection): bool |
||
176 | |||
177 | /** |
||
178 | * {@inheritdoc} |
||
179 | */ |
||
180 | public function supportsNormalization($data, $format = null) |
||
188 | } |
||
189 |