/** * Check whether attribute is visible * * @param \Magento\Eav\Model\Entity\Attribute $attribute * @return bool */ protected function _isAttributeVisible(\Magento\Eav\Model\Entity\Attribute $attribute) { return !(!$attribute || $attribute->hasIsVisible() && !$attribute->getIsVisible()); }