-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨add optional filter for get requests (#414)
✨add optional filter for get requests ✨introduce new extension bundle
- Loading branch information
1 parent
aa4d23d
commit 2329380
Showing
14 changed files
with
421 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...yx/Zed/RepresentativeCompanyUserTradeFairRestApi/Business/Model/Mapper/RestDataMapper.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace FondOfOryx\Zed\RepresentativeCompanyUserTradeFairRestApi\Business\Model\Mapper; | ||
|
||
use Generated\Shared\Transfer\CustomerTransfer; | ||
use Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairCollectionTransfer; | ||
use Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairTransfer; | ||
use Generated\Shared\Transfer\RestRepresentativeCompanyUserTradeFairCollectionTransfer; | ||
use Generated\Shared\Transfer\RestRepresentativeCompanyUserTradeFairTransfer; | ||
use Generated\Shared\Transfer\RestRepresentativeDistributorTransfer; | ||
|
||
class RestDataMapper implements RestDataMapperInterface | ||
{ | ||
/** | ||
* @param \Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairTransfer $companyUserTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\RestRepresentativeCompanyUserTradeFairTransfer | ||
*/ | ||
public function mapResponse(RepresentativeCompanyUserTradeFairTransfer $companyUserTransfer): RestRepresentativeCompanyUserTradeFairTransfer | ||
{ | ||
return (new RestRepresentativeCompanyUserTradeFairTransfer()) | ||
->fromArray($companyUserTransfer->toArray(), true) | ||
->setDistributor($this->mapRestRepresentativeDistributor($companyUserTransfer->getDistributor())); | ||
} | ||
|
||
/** | ||
* @param \Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairCollectionTransfer $companyUserCollectionTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\RestRepresentativeCompanyUserTradeFairCollectionTransfer | ||
*/ | ||
public function mapResponseCollection( | ||
RepresentativeCompanyUserTradeFairCollectionTransfer $companyUserCollectionTransfer | ||
): RestRepresentativeCompanyUserTradeFairCollectionTransfer { | ||
$restResponseCollection = new RestRepresentativeCompanyUserTradeFairCollectionTransfer(); | ||
|
||
foreach ($companyUserCollectionTransfer->getRepresentations() as $representation) { | ||
$restResponseCollection->addRepresentation($this->mapResponse($representation)); | ||
} | ||
|
||
return $restResponseCollection; | ||
} | ||
|
||
/** | ||
* @param \Generated\Shared\Transfer\CustomerTransfer|null $customerTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\RestRepresentativeDistributorTransfer|null | ||
*/ | ||
protected function mapRestRepresentativeDistributor(?CustomerTransfer $customerTransfer): ?RestRepresentativeDistributorTransfer | ||
{ | ||
if ($customerTransfer === null) { | ||
return null; | ||
} | ||
|
||
return (new RestRepresentativeDistributorTransfer()) | ||
->fromArray($customerTransfer->toArray(), true); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...presentativeCompanyUserTradeFairRestApi/Business/Model/Mapper/RestDataMapperInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace FondOfOryx\Zed\RepresentativeCompanyUserTradeFairRestApi\Business\Model\Mapper; | ||
|
||
use Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairCollectionTransfer; | ||
use Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairTransfer; | ||
use Generated\Shared\Transfer\RestRepresentativeCompanyUserTradeFairCollectionTransfer; | ||
use Generated\Shared\Transfer\RestRepresentativeCompanyUserTradeFairTransfer; | ||
|
||
interface RestDataMapperInterface | ||
{ | ||
/** | ||
* @param \Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairTransfer $companyUserTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\RestRepresentativeCompanyUserTradeFairTransfer | ||
*/ | ||
public function mapResponse(RepresentativeCompanyUserTradeFairTransfer $companyUserTransfer): RestRepresentativeCompanyUserTradeFairTransfer; | ||
|
||
/** | ||
* @param \Generated\Shared\Transfer\RepresentativeCompanyUserTradeFairCollectionTransfer $companyUserCollectionTransfer | ||
* | ||
* @return \Generated\Shared\Transfer\RestRepresentativeCompanyUserTradeFairCollectionTransfer | ||
*/ | ||
public function mapResponseCollection( | ||
RepresentativeCompanyUserTradeFairCollectionTransfer $companyUserCollectionTransfer | ||
): RestRepresentativeCompanyUserTradeFairCollectionTransfer; | ||
} |
Oops, something went wrong.