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||2019-01-10 16:42|
|Target Version||Fixed in Version|
|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.