aboutsummaryrefslogtreecommitdiffstats
path: root/lib/db
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-07-11 18:47:19 +0200
committerBart Visscher <bartv@thisnet.nl>2013-07-13 12:01:14 +0200
commit5549c77ec5256722fc11e92745c8fe769bece285 (patch)
tree876411d0a0181ec31177ec3425c81d25a25760da /lib/db
parentab2037ab5d215220c7edbd0685f4f3b25d523258 (diff)
parentc5f2ea9a9511e78d724bb1c90748f894bb8b57af (diff)
downloadnextcloud-server-5549c77ec5256722fc11e92745c8fe769bece285.tar.gz
nextcloud-server-5549c77ec5256722fc11e92745c8fe769bece285.zip
Merge branch 'master' into doctrine
Conflicts: 3rdparty lib/db.php lib/setup.php tests/lib/db.php tests/lib/dbschema.php
Diffstat (limited to 'lib/db')
-rw-r--r--lib/db/statementwrapper.php23
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/db/statementwrapper.php b/lib/db/statementwrapper.php
index 0d650186412..f7bc45e068f 100644
--- a/lib/db/statementwrapper.php
+++ b/lib/db/statementwrapper.php
@@ -13,11 +13,13 @@ class OC_DB_StatementWrapper {
/**
* @var \Doctrine\DBAL\Driver\Statement
*/
- private $statement=null;
- private $lastArguments=array();
+ private $statement = null;
+ private $isManipulation = false;
+ private $lastArguments = array();
- public function __construct($statement) {
- $this->statement=$statement;
+ public function __construct($statement, $isManipulation) {
+ $this->statement = $statement;
+ $this->isManipulation = $isManipulation;
}
/**
@@ -65,16 +67,19 @@ class OC_DB_StatementWrapper {
$input = $this->tryFixSubstringLastArgumentDataForMSSQL($input);
}
- $result=$this->statement->execute($input);
+ $result = $this->statement->execute($input);
} else {
- $result=$this->statement->execute();
+ $result = $this->statement->execute();
}
- if ($result) {
- return $this;
- } else {
+ if ($result === false) {
return false;
}
+ if ($this->isManipulation) {
+ return $this->statement->rowCount();
+ } else {
+ return $this;
+ }
}
private function tryFixSubstringLastArgumentDataForMSSQL($input) {