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-sales-admin-ui
Model
OptionSource
WebsiteSource.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventorySalesAdminUi\Model\OptionSource
;
9
10
use
Magento\Framework\Data\OptionSourceInterface
;
11
use
Magento\Store\Api\Data\WebsiteInterface
;
12
use
Magento\Store\Api\WebsiteRepositoryInterface
;
13
17
class
WebsiteSource
implements
OptionSourceInterface
18
{
22
private
$websiteRepository;
23
27
public
function
__construct
(
28
WebsiteRepositoryInterface
$websiteRepository
29
) {
30
$this->websiteRepository =
$websiteRepository
;
31
}
32
36
public
function
toOptionArray
(): array
37
{
38
$websites
= [];
39
foreach
($this->websiteRepository->getList() as
$website
) {
40
if
(
$website
->getCode() ===
WebsiteInterface::ADMIN_CODE
) {
41
continue
;
42
}
43
$websites
[] = [
44
'value'
=>
$website
->getCode(),
45
'label'
=>
$website
->getName(),
46
];
47
}
48
return
$websites
;
49
}
50
}
Magento\InventorySalesAdminUi\Model\OptionSource\WebsiteSource
Definition:
WebsiteSource.php:17
Magento\Store\Api\Data\WebsiteInterface\ADMIN_CODE
const ADMIN_CODE
Definition:
WebsiteInterface.php:19
Magento\InventorySalesAdminUi\Model\OptionSource\WebsiteSource\toOptionArray
toOptionArray()
Definition:
WebsiteSource.php:36
$website
$website
Definition:
payment_configuration_rollback.php:38
Magento\InventorySalesAdminUi\Model\OptionSource\WebsiteSource\__construct
__construct(WebsiteRepositoryInterface $websiteRepository)
Definition:
WebsiteSource.php:27
$websites
$websites
Definition:
products_virtual.php:36
Magento\Framework\Data\OptionSourceInterface
Definition:
OptionSourceInterface.php:14
Magento\Store\Api\Data\WebsiteInterface
Definition:
WebsiteInterface.php:14
$websiteRepository
$websiteRepository
Definition:
payment_configuration_rollback.php:37
Magento\InventorySalesAdminUi\Model\OptionSource
Definition:
WebsiteSource.php:8
Magento\Store\Api\WebsiteRepositoryInterface
Definition:
WebsiteRepositoryInterface.php:16