Example #1
0
 /**
  * Returns the compiled name of the SQL field (depending on multilingual attributes).
  *
  * @return string
  */
 protected function getFieldForSQL()
 {
     if ($this->isMultilingualAttribute() && Product::countTranslatedProducts()) {
         $field = sprintf('IFNULL(translation.%s, %s.%s)', $this->arrConfig['attribute'], Product::getTable(), $this->arrConfig['attribute']);
     } else {
         $field = Product::getTable() . '.' . $this->arrConfig['attribute'];
     }
     return $field;
 }