Closed gaillafr closed 10 years ago
we can not use PrestaShop's internal database classes in the generic SDK. It's OK?
We can leverage prestashop's API to get hold of a connection object (instead generting one ourselves). and provide that to our generic Library. Using presta-specific code inside our generic lib does not really make sense, does it?
Here is a simple workaround that could help you:
To do so, it's very easy:
$pdo_from_prestashop = new DbPDO(); $pdo_from_prestashop->connect(); $pdo = $pdo2->link;
You probably need to include config.inc.php and init.php to make sure DbPDO would be recognized by our autoload and for the database connection to be initiated.
Check the newly pushed version, commit: f9cf09425986ed30c9b14b35627d8f8e47d5d35f or later
You cannot create your own class, you have to use the classes & methods given by the core, i.e: Db::getInstance()->execute(...);