From 0ecaa64beea3c44bf4ee960cd88aba1f270ed305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Be=C3=9Fler?= Date: Thu, 18 Jul 2024 20:00:03 +0200 Subject: [PATCH] Switched buildDataForExport from private to public for custom DataTransformers --- src/SimpleDTO.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/SimpleDTO.php b/src/SimpleDTO.php index b44c264..1bb3485 100644 --- a/src/SimpleDTO.php +++ b/src/SimpleDTO.php @@ -288,6 +288,16 @@ protected function buildCasts(): array ]; } + protected function buildDataForExport(): array + { + $mapping = [ + ...$this->mapToTransform(), + ...$this->dtoMapTransform, + ]; + + return $this->mapDTOData($mapping, $this->validatedData); + } + private function buildAttributesData(): void { $publicProperties = $this->getPublicProperties(); @@ -372,16 +382,6 @@ private function buildDataForValidation(array $data): array return $this->mapDTOData($mapping, $data); } - private function buildDataForExport(): array - { - $mapping = [ - ...$this->mapToTransform(), - ...$this->dtoMapTransform, - ]; - - return $this->mapDTOData($mapping, $this->validatedData); - } - private function mapDTOData(array $mapping, array $data): array { $mappedData = [];