public function getValue() { if (in_array($this->getAttribute(), ['stock.is_in_stock', 'has_image', 'price.is_discount'])) { $this->setData('value', 1); } return $this->getData('value'); }
/** * Update the condition value to ignore empty array items. * * @param ProductCondition $productCondition Product condition. * * @return $this */ private function prepareFieldValue(ProductCondition $productCondition) { $value = $productCondition->getValue(); if (is_array($value)) { $value = array_filter($value); } $productCondition->setValue($value); return $this; }