Skip to content

Commit

Permalink
Merge pull request #82 from felixbessler/main
Browse files Browse the repository at this point in the history
Switched buildDataForExport from private to public for custom DataTransformers
  • Loading branch information
WendellAdriel authored Jul 19, 2024
2 parents 93721ce + 0ecaa64 commit 102c311
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/SimpleDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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 = [];
Expand Down

0 comments on commit 102c311

Please sign in to comment.