View Issue Details

IDProjectCategoryView StatusLast Update
0006878OXID eShop (all versions)4.01. Database handlingpublic2022-02-02 09:49
Status acknowledgedResolutionopen 
Product Version6.0.2 
Target VersionFixed in Version 
Summary0006878: \OxidEsales\Eshop\Core\Database\Adapter\Doctrine\Database cannot be overriden
DescriptionI 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 ReproduceCreate 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 InformationIn some cases it is essential to extend functions here. In my case i need to set a special Option for the database connection:

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.
BrowserNot defined
PHP VersionAll
Database VersionAll


There are no notes attached to this issue.