File tree Expand file tree Collapse file tree 4 files changed +16
-21
lines changed
Model/ResourceModel/OrderPickupLocation Expand file tree Collapse file tree 4 files changed +16
-21
lines changed Original file line number Diff line number Diff line change 14
14
*/
15
15
class GetPickupLocationByOrderId
16
16
{
17
- private const ORDER_ID = 'order_id ' ;
17
+ private const ORDER_ID = 'order_id ' ;
18
+
18
19
private const PICKUP_LOCATION_CODE = 'pickup_location_code ' ;
19
20
20
21
/**
@@ -23,8 +24,6 @@ class GetPickupLocationByOrderId
23
24
private $ connection ;
24
25
25
26
/**
26
- * GetPickupLocationByOrderId constructor.
27
- *
28
27
* @param \Magento\Framework\App\ResourceConnection $connection
29
28
*/
30
29
public function __construct (
@@ -40,15 +39,13 @@ public function __construct(
40
39
*
41
40
* @return string|null
42
41
*/
43
- public function execute (int $ orderId ):?string
42
+ public function execute (int $ orderId ): ?string
44
43
{
45
44
$ connection = $ this ->connection ->getConnection ();
46
45
$ table = $ this ->connection ->getTableName ('inventory_pickup_location_order ' );
47
46
48
47
$ select = $ connection ->select ()
49
- ->from ($ table , [
50
- self ::PICKUP_LOCATION_CODE => self ::PICKUP_LOCATION_CODE
51
- ])
48
+ ->from ($ table , [self ::PICKUP_LOCATION_CODE => self ::PICKUP_LOCATION_CODE ])
52
49
->where (self ::ORDER_ID . '= ? ' , $ orderId )
53
50
->limit (1 );
54
51
Original file line number Diff line number Diff line change 14
14
*/
15
15
class SaveOrderPickupLocation
16
16
{
17
- private const ORDER_ID = 'order_id ' ;
17
+ private const ORDER_ID = 'order_id ' ;
18
18
private const PICKUP_LOCATION_CODE = 'pickup_location_code ' ;
19
19
20
20
/**
@@ -41,7 +41,7 @@ public function __construct(
41
41
*
42
42
* @return void
43
43
*/
44
- public function execute (int $ orderId , string $ pickupLocationCode ):void
44
+ public function execute (int $ orderId , string $ pickupLocationCode ): void
45
45
{
46
46
$ connection = $ this ->connection ->getConnection ();
47
47
$ table = $ this ->connection ->getTableName ('inventory_pickup_location_order ' );
Original file line number Diff line number Diff line change @@ -28,9 +28,7 @@ class GetPickupLocationForOrderPlugin
28
28
private $ getPickupLocationByOrderId ;
29
29
30
30
/**
31
- * GetPickupLocationForOrderPlugin constructor.
32
- *
33
- * @param OrderExtensionFactory $orderExtensionFactory
31
+ * @param OrderExtensionFactory $orderExtensionFactory
34
32
* @param GetPickupLocationByOrderId $getPickupLocationByOrderId
35
33
*/
36
34
public function __construct (
@@ -42,16 +40,16 @@ public function __construct(
42
40
}
43
41
44
42
/**
43
+ * Add Pickup Location Code extension attribute when loading Order with OrderRepository.
44
+ *
45
45
* @param OrderRepositoryInterface $orderRepository
46
- * @param OrderInterface $order
46
+ * @param OrderInterface $order
47
47
*
48
48
* @return OrderInterface
49
49
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
50
50
*/
51
- public function afterGet (
52
- OrderRepositoryInterface $ orderRepository ,
53
- OrderInterface $ order
54
- ):OrderInterface {
51
+ public function afterGet (OrderRepositoryInterface $ orderRepository , OrderInterface $ order ): OrderInterface
52
+ {
55
53
$ extension = $ order ->getExtensionAttributes ();
56
54
57
55
if (empty ($ extension )) {
Original file line number Diff line number Diff line change @@ -22,8 +22,6 @@ class SavePickupLocationForOrderPlugin
22
22
private $ saveOrderPickupLocation ;
23
23
24
24
/**
25
- * SavePickupLocationForOrderPlugin constructor.
26
- *
27
25
* @param SaveOrderPickupLocation $saveOrderPickupLocation
28
26
*/
29
27
public function __construct (SaveOrderPickupLocation $ saveOrderPickupLocation )
@@ -32,9 +30,11 @@ public function __construct(SaveOrderPickupLocation $saveOrderPickupLocation)
32
30
}
33
31
34
32
/**
33
+ * Save Order to Pickup Location relation when saving the order.
34
+ *
35
35
* @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository
36
- * @param \Magento\Sales\Api\Data\OrderInterface $result
37
- * @param \Magento\Sales\Api\Data\OrderInterface $entity
36
+ * @param \Magento\Sales\Api\Data\OrderInterface $result
37
+ * @param \Magento\Sales\Api\Data\OrderInterface $entity
38
38
*
39
39
* @return \Magento\Sales\Api\Data\OrderInterface
40
40
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
You can’t perform that action at this time.
0 commit comments