1 | <?php |
||
35 | class ConfigurationProcessor implements ConfigurationProcessorInterface |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * The repository to access store websites. |
||
40 | * |
||
41 | * @var \TechDivision\Import\Repositories\StoreWebsiteRepositoryInterface |
||
42 | */ |
||
43 | protected $storeWebsiteRepository; |
||
44 | |||
45 | /** |
||
46 | * The core config data loader instance. |
||
47 | * |
||
48 | * @var \TechDivision\Import\Loaders\LoaderInterface |
||
49 | */ |
||
50 | protected $coreConfigDataLoader; |
||
51 | |||
52 | /** |
||
53 | * Initialize the processor with the necessary assembler and repository instances. |
||
54 | * |
||
55 | * @param \TechDivision\Import\Repositories\StoreWebsiteRepositoryInterface $storeWebsiteRepository The repository to access store websites |
||
56 | * @param \TechDivision\Import\Repositories\CoreConfigDataRepositoryInterface $coreConfigDataRepository The repository to access the configuration |
||
57 | */ |
||
58 | public function __construct( |
||
65 | |||
66 | /** |
||
67 | * Set's the repository to access store websites. |
||
68 | * |
||
69 | * @param \TechDivision\Import\Repositories\StoreWebsiteRepositoryInterface $storeWebsiteRepository The repository the access store websites |
||
70 | * |
||
71 | * @return void |
||
72 | */ |
||
73 | public function setStoreWebsiteRepository(StoreWebsiteRepositoryInterface $storeWebsiteRepository) |
||
77 | |||
78 | /** |
||
79 | * Return's the repository to access store websites. |
||
80 | * |
||
81 | * @return \TechDivision\Import\Repositories\StoreWebsiteRepositoryInterface The repository instance |
||
82 | */ |
||
83 | public function getStoreWebsiteRepository() |
||
87 | |||
88 | /** |
||
89 | * Set's the repository to access the Magento 2 configuration. |
||
90 | * |
||
91 | * @param \TechDivision\Import\Repositories\CoreConfigDataRepositoryInterface $coreConfigDataRepository The repository to access the Magento 2 configuration |
||
92 | * |
||
93 | * @return void |
||
94 | */ |
||
95 | public function setCoreConfigDataRepository(CoreConfigDataRepositoryInterface $coreConfigDataRepository) |
||
99 | |||
100 | /** |
||
101 | * Return's the repository to access the Magento 2 configuration. |
||
102 | * |
||
103 | * @return \TechDivision\Import\Repositories\CoreConfigDataRepositoryInterface The repository instance |
||
104 | */ |
||
105 | public function getCoreConfigDataRepository() |
||
109 | |||
110 | /** |
||
111 | * Return's an array with the available store websites. |
||
112 | * |
||
113 | * @return array The array with the available store websites |
||
114 | */ |
||
115 | public function getStoreWebsites() |
||
119 | |||
120 | /** |
||
121 | * Return's an array with the Magento 2 configuration. |
||
122 | * |
||
123 | * @return array The Magento 2 configuration |
||
124 | */ |
||
125 | public function getCoreConfigData() |
||
129 | } |
||
130 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: