View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004763 | OXID eShop (all versions) | 4.05. Performance | public | 2012-11-30 14:40 | 2012-12-10 13:29 |
Reporter | FibreFoX | Assigned To | |||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.7.1 / 5.0.1 revision 52468 | ||||
Fixed in Version | 4.7.2 / 5.0.2 revision 53018 | ||||
Summary | 0004763: oxDb::getInstance without fetchMode makes it hard to use it | ||||
Description | oxDb::getInstance uses an cached version of oxDb, but it creates a new one with default-settings, in this case with $iFetchMode = oxDb::FETCH_MODE_NUM, so you have to use oxDb::getDb(oxDb::FETCH_MODE_ASSOC) or have to set fetchMode later, which blows up some code. | ||||
Tags | Performance | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
Maybe it is a good thing to reduce "getDb" and "getInstance" to only ONE thing |
|
oxDb::getInstance() - should be used only when we want to use oxDB methods: quoteArray() , escapeString() etc. for data manipulation must be oxdb::getDb(): oxDb::getDB()->select(...); oxDb::getDB( oxdb::FETCH_MODE_ASSOC )->getAll(...); $oDb =oxDb::getDB(); $oDb->getOne(...); $oDb->setFetchMode(oxdb::FETCH_MODE_ASSOC); .... |
|
also remove oxDb::getInstance()->getDB() usage in code |