also use backwards compatible method for mapper
This commit is contained in:
parent
c52bd10361
commit
f77ae37f23
|
@ -27,6 +27,7 @@
|
||||||
namespace OCP\AppFramework\Db;
|
namespace OCP\AppFramework\Db;
|
||||||
|
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
|
use OCP\IDb;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -193,7 +194,11 @@ abstract class Mapper {
|
||||||
* @return \PDOStatement the database query result
|
* @return \PDOStatement the database query result
|
||||||
*/
|
*/
|
||||||
protected function execute($sql, array $params=[], $limit=null, $offset=null){
|
protected function execute($sql, array $params=[], $limit=null, $offset=null){
|
||||||
$query = $this->db->prepare($sql, $limit, $offset);
|
if ($this->db instanceof IDb) {
|
||||||
|
$query = $this->db->prepareQuery($sql, $limit, $offset);
|
||||||
|
} else {
|
||||||
|
$query = $this->db->prepare($sql, $limit, $offset);
|
||||||
|
}
|
||||||
|
|
||||||
$index = 1; // bindParam is 1 indexed
|
$index = 1; // bindParam is 1 indexed
|
||||||
foreach($params as $param) {
|
foreach($params as $param) {
|
||||||
|
|
Loading…
Reference in New Issue