/** * Load the attribute for this filter * Required to prepare choice url params and filter configuration * * @throws \LogicException * * @return AttributeInterface */ protected function getAttribute() { $fieldName = $this->get(ProductFilterUtility::DATA_NAME_KEY); $attribute = $this->attributeRepository->findOneByCode($fieldName); if (!$attribute) { throw new \LogicException(sprintf('There is no attribute with code %s.', $fieldName)); } return $attribute; }