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-eav
Model
Entity
Attribute
Source
Config.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Eav\Model\Entity\Attribute\Source
;
7
15
class
Config
extends
\Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
16
{
20
protected
$_optionsData
;
21
26
public
function
__construct
(array
$options
)
27
{
28
$this->_optionsData =
$options
;
29
}
30
37
public
function
getAllOptions
()
38
{
39
if
($this->_options ===
null
) {
40
$this->_options = [];
41
42
if
(empty($this->_optionsData)) {
43
throw
new \Magento\Framework\Exception\LocalizedException(
__
(
'No options found.'
));
44
}
45
foreach
($this->_optionsData as
$option
) {
46
$this->_options[] = [
'value'
=>
$option
[
'value'
],
'label'
=>
__
(
$option
[
'label'
])];
47
}
48
}
49
50
return
$this->_options
;
51
}
52
}
Magento\Eav\Model\Entity\Attribute\Source\AbstractSource\$_options
$_options
Definition:
AbstractSource.php:32
Magento\Eav\Model\Entity\Attribute\Source\Config
Definition:
Config.php:15
Magento\Eav\Model\Entity\Attribute\Source\Config\getAllOptions
getAllOptions()
Definition:
Config.php:37
Magento\Eav\Model\Entity\Attribute\Source
Definition:
AbstractSource.php:6
__
__()
Definition:
__.php:13
Magento\Eav\Model\Entity\Attribute\Source\Config\$_optionsData
$_optionsData
Definition:
Config.php:20
Magento\Eav\Model\Entity\Attribute\Source\Config\__construct
__construct(array $options)
Definition:
Config.php:26
$option
$option
Definition:
product_configurable_with_single_child.php:38
$options
$options
Definition:
multiple_mixed_products.php:29