also use backwards compatible method for mapper

This commit is contained in:
Bernhard Posselt 2015-03-18 22:20:23 +01:00
parent c52bd10361
commit f77ae37f23
1 changed files with 6 additions and 1 deletions

View File

@ -27,6 +27,7 @@
namespace OCP\AppFramework\Db;
use OCP\IDBConnection;
use OCP\IDb;
/**
@ -193,7 +194,11 @@ abstract class Mapper {
* @return \PDOStatement the database query result
*/
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
foreach($params as $param) {