-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from logeecom/release/v1.5.0
Release v1.5.0
- Loading branch information
Showing
74 changed files
with
2,011 additions
and
295 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
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
64 changes: 64 additions & 0 deletions
64
src/BusinessLogic/OrderShipmentDetails/OrderShipmentDetailsService.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,64 @@ | ||
<?php | ||
|
||
namespace Packlink\BusinessLogic\OrderShipmentDetails; | ||
|
||
use Logeecom\Infrastructure\ORM\Interfaces\RepositoryInterface; | ||
use Logeecom\Infrastructure\ORM\QueryFilter\Operators; | ||
use Logeecom\Infrastructure\ORM\QueryFilter\QueryFilter; | ||
use Packlink\BusinessLogic\BaseService; | ||
use Packlink\BusinessLogic\Order\Models\OrderShipmentDetails; | ||
|
||
/** | ||
* Class OrderShipmentDetailsService | ||
* | ||
* @package Packlink\BusinessLogic\OrderShipmentDetails | ||
*/ | ||
class OrderShipmentDetailsService extends BaseService | ||
{ | ||
/** | ||
* Fully qualified name of this class. | ||
*/ | ||
const CLASS_NAME = __CLASS__; | ||
/** | ||
* Singleton instance of this class. | ||
* | ||
* @var static | ||
*/ | ||
protected static $instance; | ||
/** | ||
* Order shipment details repository. | ||
* | ||
* @var RepositoryInterface | ||
*/ | ||
protected $orderShipmentDetailsRepository; | ||
|
||
/** | ||
* OrderShipmentDetailsService constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->orderShipmentDetailsRepository = $this->getRepository(OrderShipmentDetails::getClassName()); | ||
} | ||
|
||
/** | ||
* Retrieves order shipment details. | ||
* | ||
* @param string | int $orderId Order id in an integration system. | ||
* | ||
* @return OrderShipmentDetails | null Instance that retrieved by the specifed id. | ||
* | ||
* @throws \Logeecom\Infrastructure\ORM\Exceptions\QueryFilterInvalidParamException | ||
*/ | ||
public function getDetailsByOrderId($orderId) | ||
{ | ||
$query = new QueryFilter(); | ||
$query->where('orderId', Operators::EQUALS, $orderId); | ||
|
||
/** @var OrderShipmentDetails | null $entity */ | ||
$entity = $this->orderShipmentDetailsRepository->selectOne($query); | ||
|
||
return $entity; | ||
} | ||
} |
Oops, something went wrong.