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
Model
SourceRepository.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Inventory\Model
;
9
10
use
Magento\Framework\Api\SearchCriteriaInterface
;
11
use
Magento\Inventory\Model\Source\Command\GetInterface
;
12
use
Magento\Inventory\Model\Source\Command\GetListInterface
;
13
use
Magento\Inventory\Model\Source\Command\SaveInterface
;
14
use
Magento\InventoryApi\Api\Data\SourceInterface
;
15
use
Magento\InventoryApi\Api\Data\SourceSearchResultsInterface
;
16
use
Magento\InventoryApi\Api\SourceRepositoryInterface
;
17
21
class
SourceRepository
implements
SourceRepositoryInterface
22
{
26
private
$commandSave;
27
31
private
$commandGet;
32
36
private
$commandGetList;
37
43
public
function
__construct
(
44
SaveInterface
$commandSave,
45
GetInterface
$commandGet,
46
GetListInterface
$commandGetList
47
) {
48
$this->commandSave = $commandSave;
49
$this->commandGet = $commandGet;
50
$this->commandGetList = $commandGetList;
51
}
52
56
public
function
save
(
SourceInterface
$source
): void
57
{
58
$this->commandSave->execute(
$source
);
59
}
60
64
public
function
get
(
string
$sourceCode
):
SourceInterface
65
{
66
return
$this->commandGet->execute(
$sourceCode
);
67
}
68
72
public
function
getList
(
SearchCriteriaInterface
$searchCriteria
=
null
):
SourceSearchResultsInterface
73
{
74
return
$this->commandGetList->execute(
$searchCriteria
);
75
}
76
}
Magento\Inventory\Model\SourceRepository\save
save(SourceInterface $source)
Definition:
SourceRepository.php:56
Magento\Inventory\Model\SourceRepository
Definition:
SourceRepository.php:21
Magento\Framework\Api\SearchCriteriaInterface
Definition:
SearchCriteriaInterface.php:15
Magento\Inventory\Model\Source\Command\SaveInterface
Definition:
SaveInterface.php:24
Magento\Inventory\Model
Definition:
GetSourceCodesBySkus.php:8
$source
$source
Definition:
source.php:23
Magento\Inventory\Model\Source\Command\GetListInterface
Definition:
GetListInterface.php:23
Magento\Inventory\Model\Source\Command\GetInterface
Definition:
GetInterface.php:23
$searchCriteria
$searchCriteria
Definition:
order_rollback.php:16
Magento\Inventory\Model\SourceRepository\getList
getList(SearchCriteriaInterface $searchCriteria=null)
Definition:
SourceRepository.php:72
$sourceCode
$sourceCode
Definition:
inventory.phtml:11
Magento\InventoryApi\Api\Data\SourceInterface
Definition:
SourceInterface.php:17
Magento\InventoryApi\Api\SourceRepositoryInterface
Definition:
SourceRepositoryInterface.php:29
Magento\Inventory\Model\SourceRepository\__construct
__construct(SaveInterface $commandSave, GetInterface $commandGet, GetListInterface $commandGetList)
Definition:
SourceRepository.php:43
Magento\InventoryApi\Api\Data\SourceSearchResultsInterface
Definition:
SourceSearchResultsInterface.php:17