View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006878 | OXID eShop (all versions) | 4.01. Database handling | public | 2018-08-08 12:18 | 2023-11-15 15:36 |
Reporter | thorsten.schneider | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Product Version | 6.0.2 | ||||
Summary | 0006878: \OxidEsales\Eshop\Core\Database\Adapter\Doctrine\Database cannot be overriden | ||||
Description | I wanted to add a connection option in addDriverOptions() in \OxidEsales\Eshop\Core\Database\Adapter\Doctrine\Database. It seems that this (and overwriting other Methods in this class) is not possible as the object is generated in \OxidEsales\EshopCommunity\Core\DatabaseProvider::createDatabase() (Line 196) with "new" instead of "oxNew". | ||||
Steps To Reproduce | Create a module that extends the class: \OxidEsales\Eshop\Core\Database\Adapter\Doctrine\Database::class => Vendor\Module\Core\Database\Adapter\Doctrine\Database::class, Overwrite a function, e.g.: protected function addDriverOptions(array &$existingParameters) { die("Actually we do something"); } This will never be called, although the database connection is set up correctly. Means our addition is not added to the chain (although you can see the addition in backend's loaded modules) | ||||
Additional Information | In some cases it is essential to extend functions here. In my case i need to set a special Option for the database connection: PDO::MYSQL_ATTR_LOCAL_INFILE => true This is not possible in this implementation. I would guess that it is not very often the case, but if it is you are stuck with a database connection that is not configurable with special PDO Options. | ||||
Tags | Database | ||||
Theme | All | ||||
Browser | Not defined | ||||
PHP Version | All | ||||
Database Version | All | ||||