]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use namedparameter
authorRoeland Jago Douma <rullzer@owncloud.com>
Mon, 11 Jan 2016 14:58:32 +0000 (15:58 +0100)
committerRoeland Jago Douma <rullzer@owncloud.com>
Thu, 14 Jan 2016 09:54:40 +0000 (10:54 +0100)
lib/private/share20/defaultshareprovider.php
tests/lib/share20/defaultshareprovidertest.php

index 7a08ecb121062b84bb95a4c9909dc7f81985df3e..1d9a2072966789f939a8e85c56730168d7db6ec2 100644 (file)
@@ -185,8 +185,7 @@ class DefaultShareProvider implements IShareProvider {
                $qb = $this->dbConn->getQueryBuilder();
                $qb->select('*')
                        ->from('share')
-                       ->where($qb->expr()->eq('parent', $qb->createParameter('parent')))
-                       ->setParameter(':parent', $parent->getId())
+                       ->where($qb->expr()->eq('parent', $qb->createNamedParameter($parent->getId())))
                        ->orderBy('id');
 
                $cursor = $qb->execute();
@@ -210,8 +209,7 @@ class DefaultShareProvider implements IShareProvider {
 
                $qb = $this->dbConn->getQueryBuilder();
                $qb->delete('share')
-                       ->where($qb->expr()->eq('id', $qb->createParameter('id')))
-                       ->setParameter(':id', $share->getId());
+                       ->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())));
        
                try {
                        $qb->execute();
@@ -244,8 +242,7 @@ class DefaultShareProvider implements IShareProvider {
 
                $qb->select('*')
                        ->from('share')
-                       ->where($qb->expr()->eq('id', $qb->createParameter('id')))
-                       ->setParameter(':id', $id);
+                       ->where($qb->expr()->eq('id', $qb->createNamedParameter($id)));
                
                $cursor = $qb->execute();
                $data = $cursor->fetch();
index 166fbd25f1764c08b45a32d44d2a8909dbb2476e..4db6b2b14e74f9781eeaf1f4ce5dafa2a8a2e117 100644 (file)
@@ -374,9 +374,6 @@ class DefaultShareProviderTest extends \Test\TestCase {
                $qb->expects($this->once())
                        ->method('where')
                        ->will($this->returnSelf());
-               $qb->expects($this->once())
-                       ->method('setParameter')
-                       ->will($this->returnSelf());
                $qb->expects($this->once())
                        ->method('execute')
                        ->will($this->throwException(new \Exception));