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
Model
Config
Source
ListSort.php
Go to the documentation of this file.
1
<?php
12
namespace
Magento\Catalog\Model\Config\Source
;
13
14
class
ListSort
implements
\Magento\Framework\Option\ArrayInterface
15
{
21
protected
$_catalogConfig
;
22
28
public
function
__construct
(\
Magento
\Catalog\Model\
Config
$catalogConfig)
29
{
30
$this->_catalogConfig = $catalogConfig;
31
}
32
38
public
function
toOptionArray
()
39
{
40
$options
= [];
41
$options
[] = [
'label'
=>
__
(
'Position'
),
'value'
=>
'position'
];
42
foreach
($this->
_getCatalogConfig
()->
getAttributesUsedForSortBy
() as
$attribute
) {
43
$options
[] = [
'label'
=>
__
(
$attribute
[
'frontend_label'
]),
'value'
=>
$attribute
[
'attribute_code'
]];
44
}
45
return
$options
;
46
}
47
53
protected
function
_getCatalogConfig
()
54
{
55
return
$this->_catalogConfig
;
56
}
57
}
Magento\TestFramework\ObjectManager\Config
Definition:
Config.php:8
Magento\Catalog\Model\Config\getAttributesUsedForSortBy
getAttributesUsedForSortBy()
Definition:
Config.php:453
Magento\Catalog\Model\Config\Source\ListSort\$_catalogConfig
$_catalogConfig
Definition:
ListSort.php:21
Magento\Catalog\Model\Config\Source\ListSort\__construct
__construct(\Magento\Catalog\Model\Config $catalogConfig)
Definition:
ListSort.php:28
Magento\Catalog\Model\Config\Source
Definition:
Category.php:6
$attribute
$attribute
Definition:
attribute_set_with_image_attribute.php:41
Magento\Catalog\Model\Config\Source\ListSort
Definition:
ListSort.php:14
__
__()
Definition:
__.php:13
Magento\Framework\Option\ArrayInterface
Definition:
ArrayInterface.php:11
Magento\Catalog\Model\Config\Source\ListSort\_getCatalogConfig
_getCatalogConfig()
Definition:
ListSort.php:53
Magento
Magento\Catalog\Model\Config\Source\ListSort\toOptionArray
toOptionArray()
Definition:
ListSort.php:38
$options
$options
Definition:
multiple_mixed_products.php:29