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-config
Model
Config
Source
Website.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Config\Model\Config\Source
;
7
12
class
Website
implements
\Magento\Framework\Option\ArrayInterface
13
{
17
protected
$_options
;
18
22
protected
$_storeManager
;
23
27
public
function
__construct
(\
Magento
\
Store
\Model\
StoreManagerInterface
$storeManager
)
28
{
29
$this->_storeManager =
$storeManager
;
30
}
31
35
public
function
toOptionArray
()
36
{
37
if
(!$this->_options) {
38
$this->_options = [];
39
foreach
($this->_storeManager->getWebsites() as
$website
) {
40
$id
=
$website
->getId();
41
$name
=
$website
->getName();
42
if
(
$id
!= 0) {
43
$this->_options[] = [
'value'
=>
$id
,
'label'
=>
$name
];
44
}
45
}
46
}
47
return
$this->_options
;
48
}
49
}
Magento\Config\Model\Config\Source\Website
Definition:
Website.php:12
Magento\Config\Model\Config\Source\Website\toOptionArray
toOptionArray()
Definition:
Website.php:35
Magento\Config\Model\Config\Source\Website\$_storeManager
$_storeManager
Definition:
Website.php:22
Magento\Config\Model\Config\Source
$id
$id
Definition:
fieldset.phtml:14
Magento\Config\Model\Config\Source\Website\$_options
$_options
Definition:
Website.php:17
$website
$website
Definition:
payment_configuration_rollback.php:38
$storeManager
$storeManager
Definition:
paypal_quote.php:14
Magento\Framework\Option\ArrayInterface
Definition:
ArrayInterface.php:11
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Config\Model\Config\Source\Website\__construct
__construct(\Magento\Store\Model\StoreManagerInterface $storeManager)
Definition:
Website.php:27
Magento\Config\Model\Config\Source\Store
Definition:
Store.php:12
Magento
$name
if(!isset($_GET['name'])) $name
Definition:
log.php:14