Skip to content

Commit b08998d

Browse files
author
roadiz-ci
committed
feat(Documents): New document_raw_relative_path serialization group to add rawRelativePath to Documents
1 parent b24134f commit b08998d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Serializer/Normalizer/DocumentNormalizer.php

+8
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ public function normalize(mixed $object, ?string $format = null, array $context
6666
$data['imageCropAlignment'] = $alignment;
6767
}
6868

69+
if (
70+
\in_array('document_raw_relative_path', $serializationGroups, true)
71+
&& !$object->isPrivate()
72+
&& null !== $rawDocument = $object->getRawDocument()
73+
) {
74+
$data['rawRelativePath'] = $rawDocument->getRelativePath();
75+
}
76+
6977
if (
7078
\in_array('document_folders_all', $serializationGroups, true)
7179
) {

0 commit comments

Comments
 (0)