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-catalog-search
Model
Source
Weight.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\CatalogSearch\Model\Source
;
7
13
class
Weight
implements
\Magento\Framework\Data\OptionSourceInterface
14
{
21
protected
$weights
= [
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'7'
,
'8'
,
'9'
,
'10'
];
22
28
public
function
getOptions
()
29
{
30
$res = [];
31
foreach
($this->
getValues
() as
$value
) {
32
$res[] = [
'value'
=>
$value
,
'label'
=>
$value
];
33
}
34
return
$res;
35
}
36
42
public
function
getValues
()
43
{
44
return
$this->weights
;
45
}
46
53
public
function
toOptionArray
()
54
{
55
return
$this->
getOptions
();
56
}
57
}
Magento\CatalogSearch\Model\Source\Weight\toOptionArray
toOptionArray()
Definition:
Weight.php:53
Magento\CatalogSearch\Model\Source\Weight
Definition:
Weight.php:13
$value
$value
Definition:
gender.phtml:16
Magento\CatalogSearch\Model\Source\Weight\getOptions
getOptions()
Definition:
Weight.php:28
Magento\Framework\Data\OptionSourceInterface
Definition:
OptionSourceInterface.php:14
Magento\CatalogSearch\Model\Source\Weight\$weights
$weights
Definition:
Weight.php:21
Magento\CatalogSearch\Model\Source
Definition:
Weight.php:6
Magento\CatalogSearch\Model\Source\Weight\getValues
getValues()
Definition:
Weight.php:42