Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function prepare()
 {
     foreach ($this->attributeRepository->getList() as $attribute) {
         if (!isset($this->components[$attribute->getAttributeCode()]) && $attribute->getIsFilterableInGrid()) {
             $filter = $this->filterFactory->create($attribute, $this->getContext());
             $filter->prepare();
             $this->addComponent($attribute->getAttributeCode(), $filter);
         }
     }
     parent::prepare();
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function prepare()
 {
     $attributeIds = $this->getContext()->getRequestParam('attributes_codes');
     if ($attributeIds) {
         foreach ($this->attributeRepository->getList() as $attribute) {
             $filter = $this->filterFactory->create($attribute, $this->getContext(), ['component' => '']);
             $filter->prepare();
             $this->addComponent($attribute->getAttributeCode(), $filter);
         }
     }
     parent::prepare();
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function prepare()
 {
     /** @var \Magento\Customer\Model\Attribute $attribute */
     foreach ($this->attributeRepository->getList() as $attributeCode => $attributeData) {
         if (!isset($this->components[$attributeCode])) {
             if (!$attributeData[AttributeMetadata::BACKEND_TYPE] != 'static' && $attributeData[AttributeMetadata::IS_USED_IN_GRID] && $attributeData[AttributeMetadata::IS_FILTERABLE_IN_GRID]) {
                 $filter = $this->filterFactory->create($attributeData, $this->getContext());
                 $filter->prepare();
                 $this->addComponent($attributeCode, $filter);
             }
         } elseif ($attributeData[AttributeMetadata::IS_USED_IN_GRID] && !$attributeData[AttributeMetadata::IS_FILTERABLE_IN_GRID]) {
             unset($this->components[$attributeCode]);
         }
     }
     parent::prepare();
 }