|
|
|
@@ -6,6 +6,7 @@ use App\ApiResource\CommentApi; |
|
|
|
use App\ApiResource\ContactApi; |
|
|
|
use App\ApiResource\PartnerApi; |
|
|
|
use App\ApiResource\ProductApi; |
|
|
|
use App\ApiResource\SaleApi; |
|
|
|
use App\ApiResource\UserApi; |
|
|
|
use App\ApiResource\PostingApi; |
|
|
|
use App\Entity\Comment; |
|
|
|
@@ -65,6 +66,13 @@ class PostingEntityToApiMapper implements MapperInterface |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
$dto->sale = null; |
|
|
|
if ($entity->getSale() !== null) { |
|
|
|
$dto->sale = $this->microMapper->map($entity->getSale(), SaleApi::class, [ |
|
|
|
MicroMapperInterface::MAX_DEPTH => 1, |
|
|
|
]); |
|
|
|
} |
|
|
|
|
|
|
|
$dto->comments = array_map(function(Comment $comment) { |
|
|
|
return $this->microMapper->map($comment, CommentApi::class, [ |
|
|
|
MicroMapperInterface::MAX_DEPTH => 1, |
|
|
|
|