View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003213 | OXID eShop (all versions) | 4.05. Performance | public | 2011-08-31 17:33 | 2012-12-10 13:29 |
Reporter | wanis | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.3.0 revision 26948 | ||||
Fixed in Version | 4.5.3 revision 39087 | ||||
Summary | 0003213: oxArticle::getManufacturerId is useless for CE and PE versions | ||||
Description | this function using additional SQL check for getting is manufacturer belongs to the same shop. if manufacturer is not active or dont exists, its checked in oxArticle::getManufacturer $oManufacturer->load( $sManufacturerId ) and $oManufacturer = $oManufacturer->oxmanufacturers__oxactive->value ? $oManufacturer : null; we should leave it for extendability, but no checking logic here. For EE versions, this function could be unchanged, as it can be used to check if article has manufacturer in lightweight way (only one DB check), but can also be deprecated, and force developers to use getManufacturer object to ensure availability to active shop. | ||||
Additional Information | I suggest to rewrite this function to public function getManufacturerId( $blForceReload = false ) { $sManufacturerId = false; if ( $this->oxarticles__oxmanufacturerid->value ) { $sManufacturerId = $this->oxarticles__oxmanufacturerid->value; } return $sManufacturerId; } and leave for EE : public function getManufacturerId( $blForceReload = false ) { $sManufacturerId = false; if ( $this->oxarticles__oxmanufacturerid->value ) { if ( !$blForceReload && isset( self::$_aArticleManufacturers[$this->getId()])) { return self::$_aArticleManufacturers[$this->getId()]; } $oDb = oxDb::getDb(); $sQ = "select oxid from ".getViewName('oxmanufacturers')." where oxid=".$oDb->quote($this->oxarticles__oxmanufacturerid->value); self::$_aArticleManufacturers[$this->getId()] = $sManufacturerId = $oDb->getOne( $sQ ); } return $sManufacturerId; } | ||||
Tags | Performance | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||