From 59bbf272539185660dd291fb052ea4e12b251604 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 25 Feb 2015 13:18:36 +0100 Subject: [PATCH] remove IDb interface from core class usage --- lib/private/server.php | 2 +- lib/private/tagging/tagmapper.php | 6 +++--- tests/lib/tags.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/private/server.php b/lib/private/server.php index a1e99274c7..bc9d11404a 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -77,7 +77,7 @@ class Server extends SimpleContainer implements IServerContainer { return new PreviewManager(); }); $this->registerService('TagMapper', function(Server $c) { - return new TagMapper($c->getDb()); + return new TagMapper($c->getDatabaseConnection()); }); $this->registerService('TagManager', function (Server $c) { $tagMapper = $c->query('TagMapper'); diff --git a/lib/private/tagging/tagmapper.php b/lib/private/tagging/tagmapper.php index dbeb552652..ed9b8af25d 100644 --- a/lib/private/tagging/tagmapper.php +++ b/lib/private/tagging/tagmapper.php @@ -22,7 +22,7 @@ namespace OC\Tagging; use \OCP\AppFramework\Db\Mapper, \OCP\AppFramework\Db\DoesNotExistException, - \OCP\IDb; + \OCP\IDBConnection; /** * Mapper for Tag entity @@ -32,9 +32,9 @@ class TagMapper extends Mapper { /** * Constructor. * - * @param IDb $db Instance of the Db abstraction layer. + * @param IDBConnection $db Instance of the Db abstraction layer. */ - public function __construct(IDb $db) { + public function __construct(IDBConnection $db) { parent::__construct($db, 'vcategory', 'OC\Tagging\Tag'); } diff --git a/tests/lib/tags.php b/tests/lib/tags.php index a50855c88f..1a13d64679 100644 --- a/tests/lib/tags.php +++ b/tests/lib/tags.php @@ -49,7 +49,7 @@ class Test_Tags extends \Test\TestCase { ->will($this->returnValue($this->user)); $this->objectType = $this->getUniqueID('type_'); - $this->tagMapper = new OC\Tagging\TagMapper(\OC::$server->getDb()); + $this->tagMapper = new OC\Tagging\TagMapper(\OC::$server->getDatabaseConnection()); $this->tagMgr = new OC\TagManager($this->tagMapper, $this->userSession); }