aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/comments
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/comments')
-rw-r--r--lib/private/comments/managerfactory.php22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/private/comments/managerfactory.php b/lib/private/comments/managerfactory.php
index c2a2e0b4891..281e8ca7fef 100644
--- a/lib/private/comments/managerfactory.php
+++ b/lib/private/comments/managerfactory.php
@@ -22,11 +22,27 @@ namespace OC\Comments;
use OCP\Comments\ICommentsManager;
use OCP\Comments\ICommentsManagerFactory;
-
+use OCP\IServerContainer;
class ManagerFactory implements ICommentsManagerFactory {
/**
+ * Server container
+ *
+ * @var IServerContainer
+ */
+ private $serverContainer;
+
+ /**
+ * Constructor for the comments manager factory
+ *
+ * @param IServerContainer $serverContainer server container
+ */
+ public function __construct(IServerContainer $serverContainer) {
+ $this->serverContainer = $serverContainer;
+ }
+
+ /**
* creates and returns an instance of the ICommentsManager
*
* @return ICommentsManager
@@ -34,8 +50,8 @@ class ManagerFactory implements ICommentsManagerFactory {
*/
public function getManager() {
return new Manager(
- \OC::$server->getDatabaseConnection(),
- \OC::$server->getLogger()
+ $this->serverContainer->getDatabaseConnection(),
+ $this->serverContainer->getLogger()
);
}
}