|
|
@@ -4,10 +4,12 @@ namespace App\Mapper; |
|
|
|
|
|
|
|
|
use App\ApiResource\ContactApi; |
|
|
use App\ApiResource\ContactApi; |
|
|
use App\ApiResource\PartnerApi; |
|
|
use App\ApiResource\PartnerApi; |
|
|
|
|
|
use App\ApiResource\PartnerProductApi; |
|
|
use App\ApiResource\PostingApi; |
|
|
use App\ApiResource\PostingApi; |
|
|
use App\ApiResource\UserApi; |
|
|
use App\ApiResource\UserApi; |
|
|
use App\Entity\Contact; |
|
|
use App\Entity\Contact; |
|
|
use App\Entity\Partner; |
|
|
use App\Entity\Partner; |
|
|
|
|
|
use App\Entity\PartnerProduct; |
|
|
use App\Entity\Posting; |
|
|
use App\Entity\Posting; |
|
|
use App\Service\FileUrlService; |
|
|
use App\Service\FileUrlService; |
|
|
use Symfonycasts\MicroMapper\AsMapper; |
|
|
use Symfonycasts\MicroMapper\AsMapper; |
|
|
@@ -63,11 +65,19 @@ class PartnerEntityToApiMapper implements MapperInterface |
|
|
MicroMapperInterface::MAX_DEPTH => 1, |
|
|
MicroMapperInterface::MAX_DEPTH => 1, |
|
|
]); |
|
|
]); |
|
|
}, $entity->getPostings()->getValues()); |
|
|
}, $entity->getPostings()->getValues()); |
|
|
|
|
|
|
|
|
$dto->contacts = array_map(function(Contact $contact) { |
|
|
$dto->contacts = array_map(function(Contact $contact) { |
|
|
return $this->microMapper->map($contact, ContactApi::class, [ |
|
|
return $this->microMapper->map($contact, ContactApi::class, [ |
|
|
MicroMapperInterface::MAX_DEPTH => 1, |
|
|
MicroMapperInterface::MAX_DEPTH => 1, |
|
|
]); |
|
|
]); |
|
|
}, $entity->getContacts()->getValues()); |
|
|
}, $entity->getContacts()->getValues()); |
|
|
|
|
|
|
|
|
|
|
|
$dto->partnerProducts = array_map(function(PartnerProduct $contact) { |
|
|
|
|
|
return $this->microMapper->map($contact, PartnerProductApi::class, [ |
|
|
|
|
|
MicroMapperInterface::MAX_DEPTH => 1, |
|
|
|
|
|
]); |
|
|
|
|
|
}, $entity->getPartnerProducts()->getValues()); |
|
|
|
|
|
|
|
|
return $dto; |
|
|
return $dto; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |