Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SourceRepository.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
17 
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 
73  {
74  return $this->commandGetList->execute($searchCriteria);
75  }
76 }
$source
Definition: source.php:23
$searchCriteria
getList(SearchCriteriaInterface $searchCriteria=null)
$sourceCode
Definition: inventory.phtml:11
__construct(SaveInterface $commandSave, GetInterface $commandGet, GetListInterface $commandGetList)