/** * Builds and returns array of SQL WHERE conditions * * @return array */ public function buildWhere() { $this->_aWhere = parent::buildWhere(); $sViewName = getViewName("oxpricealarm"); $sArtViewName = getViewName("oxarticles"); // updating price fields values for correct search in DB if (isset($this->_aWhere[$sViewName . '.oxprice'])) { $sPriceParam = (double) str_replace(array('%', ','), array('', '.'), $this->_aWhere[$sViewName . '.oxprice']); $this->_aWhere[$sViewName . '.oxprice'] = '%' . $sPriceParam . '%'; } if (isset($this->_aWhere[$sArtViewName . '.oxprice'])) { $sPriceParam = (double) str_replace(array('%', ','), array('', '.'), $this->_aWhere[$sArtViewName . '.oxprice']); $this->_aWhere[$sArtViewName . '.oxprice'] = '%' . $sPriceParam . '%'; } return $this->_aWhere; }
/** * Sets SQL WHERE condition. Returns array of conditions. * * @return array */ public function buildWhere() { // we override this to add our shop if we are not malladmin $this->_aWhere = parent::buildWhere(); if (!oxRegistry::getSession()->getVariable('malladmin')) { // we only allow to see our shop $this->_aWhere[getViewName("oxshops") . ".oxid"] = oxRegistry::getSession()->getVariable("actshop"); } return $this->_aWhere; }
/** * Builds and returns array of SQL WHERE conditions. * * @return array */ public function buildWhere() { // we override this to select only parent articles $this->_aWhere = parent::buildWhere(); // adding folder check $sFolder = oxRegistry::getConfig()->getRequestParameter('folder'); if ($sFolder && $sFolder != '-1') { $this->_aWhere[getViewName("oxarticles") . ".oxfolder"] = $sFolder; } return $this->_aWhere; }