17 class Sortby extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
33 $this->_scopeConfig = $scopeConfig;
48 $postDataConfig = $object->getData(
'use_post_data_config') ?: [];
61 throw new \Magento\Framework\Exception\LocalizedException(
62 __(
'The value of the "%1" attribute isn\'t unique. Set a unique value and try again.',
$label)
68 $available = $object->getData(
'available_sort_by') ?: [];
69 $available = is_array($available) ? $available : explode(
',', $available);
75 ) : $this->_scopeConfig->getValue(
76 "catalog/frontend/default_sort_by",
79 if (!in_array(
$data, $available) && !in_array(
'available_sort_by', $postDataConfig)) {
80 throw new \Magento\Framework\Exception\LocalizedException(
81 __(
'Default Product Listing Sort by does not exist in Available Product Listing Sort By.')
100 if (!is_array(
$data)) {
123 if (!is_array(
$data)) {
__construct(\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig)