Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-inventory-shipping
Model
ResourceModel
ShipmentSource
GetSourceCodeByShipmentId.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource
;
9
10
use
Magento\Framework\App\ResourceConnection
;
11
15
class
GetSourceCodeByShipmentId
16
{
20
const
SHIPMENT_ID
=
'shipment_id'
;
21
const
SOURCE_CODE
=
'source_code'
;
22
26
private
$resourceConnection;
27
31
public
function
__construct
(
ResourceConnection
$resourceConnection)
32
{
33
$this->resourceConnection =
$resourceConnection
;
34
}
35
42
public
function
execute
(
int
$shipmentId)
43
{
44
$connection
= $this->resourceConnection->getConnection();
45
$tableName
= $this->resourceConnection
46
->getTableName(
'inventory_shipment_source'
);
47
48
$select
=
$connection
->select()
49
->from(
$tableName
, [
50
self::SOURCE_CODE => self::SOURCE_CODE
51
])
52
->where(self::SHIPMENT_ID .
' = ?'
, $shipmentId)
53
->limit(1);
54
55
$sourceCode
=
$connection
->fetchOne(
$select
);
56
57
return
$sourceCode
?:
null
;
58
}
59
}
$tableName
$tableName
Definition:
trigger.php:13
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\GetSourceCodeByShipmentId\__construct
__construct(ResourceConnection $resourceConnection)
Definition:
GetSourceCodeByShipmentId.php:31
$select
$select
Definition:
catalog_rule_10_off_not_logged_rollback.php:14
$sourceCode
$sourceCode
Definition:
inventory.phtml:11
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\GetSourceCodeByShipmentId
Definition:
GetSourceCodeByShipmentId.php:15
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource
Definition:
DeleteShipmentSource.php:8
$resourceConnection
$resourceConnection
Definition:
website_attribute_sync.php:32
Magento\Framework\App\ResourceConnection
Definition:
ResourceConnection.php:18
$connection
$connection
Definition:
bulk.php:13
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\GetSourceCodeByShipmentId\SOURCE_CODE
const SOURCE_CODE
Definition:
GetSourceCodeByShipmentId.php:21
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\GetSourceCodeByShipmentId\SHIPMENT_ID
const SHIPMENT_ID
Definition:
GetSourceCodeByShipmentId.php:20
Magento\Framework\App\ResourceConnection
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\GetSourceCodeByShipmentId\execute
execute(int $shipmentId)
Definition:
GetSourceCodeByShipmentId.php:42