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
SaveShipmentSource.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
SaveShipmentSource
16
{
20
const
SHIPMENT_ID
=
'shipment_id'
;
21
const
SOURCE_CODE
=
'source_code'
;
22
26
private
$resourceConnection;
27
31
public
function
__construct
(
32
ResourceConnection
$resourceConnection
33
) {
34
$this->resourceConnection =
$resourceConnection
;
35
}
36
42
public
function
execute
(
int
$shipmentId,
string
$sourceCode
)
43
{
44
$connection
= $this->resourceConnection->getConnection();
45
$tableName
= $this->resourceConnection->getTableName(
'inventory_shipment_source'
);
46
47
$data
= [
48
self::SHIPMENT_ID => $shipmentId,
49
self::SOURCE_CODE =>
$sourceCode
50
];
51
52
$connection
->insertOnDuplicate(
$tableName
,
$data
, [self::SOURCE_CODE]);
53
}
54
}
$tableName
$tableName
Definition:
trigger.php:13
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\SaveShipmentSource\__construct
__construct(ResourceConnection $resourceConnection)
Definition:
SaveShipmentSource.php:31
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\SaveShipmentSource\SOURCE_CODE
const SOURCE_CODE
Definition:
SaveShipmentSource.php:21
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
$sourceCode
$sourceCode
Definition:
inventory.phtml:11
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\SaveShipmentSource
Definition:
SaveShipmentSource.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\Framework\App\ResourceConnection
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\SaveShipmentSource\SHIPMENT_ID
const SHIPMENT_ID
Definition:
SaveShipmentSource.php:20
Magento\InventoryShipping\Model\ResourceModel\ShipmentSource\SaveShipmentSource\execute
execute(int $shipmentId, string $sourceCode)
Definition:
SaveShipmentSource.php:42