From 899f9bd113304d77b865653768450f6013824553 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 19 Jan 2016 16:17:49 +0100 Subject: Allow custom implementation of system tag managers Added config.php option to replace the default implementation of system tag manager and system tag object mapper. Also adjusted the comments manager factory to inject the server container --- lib/public/comments/icommentsmanagerfactory.php | 10 ++++ lib/public/systemtag/isystemtagmanagerfactory.php | 59 +++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 lib/public/systemtag/isystemtagmanagerfactory.php (limited to 'lib/public') diff --git a/lib/public/comments/icommentsmanagerfactory.php b/lib/public/comments/icommentsmanagerfactory.php index 03a2b16b310..2e71719019c 100644 --- a/lib/public/comments/icommentsmanagerfactory.php +++ b/lib/public/comments/icommentsmanagerfactory.php @@ -20,6 +20,8 @@ */ namespace OCP\Comments; +use OCP\IServerContainer; + /** * Interface ICommentsManagerFactory * @@ -31,6 +33,14 @@ namespace OCP\Comments; */ interface ICommentsManagerFactory { + /** + * Constructor for the comments manager factory + * + * @param IServerContainer $serverContainer server container + * @since 9.0.0 + */ + public function __construct(IServerContainer $serverContainer); + /** * creates and returns an instance of the ICommentsManager * diff --git a/lib/public/systemtag/isystemtagmanagerfactory.php b/lib/public/systemtag/isystemtagmanagerfactory.php new file mode 100644 index 00000000000..ad7467633b1 --- /dev/null +++ b/lib/public/systemtag/isystemtagmanagerfactory.php @@ -0,0 +1,59 @@ + + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see + * + */ +namespace OCP\SystemTag; + +use OCP\IServerContainer; + +/** + * Interface ISystemTagManagerFactory + * + * Factory interface for system tag managers + * + * @package OCP\SystemTag + * @since 9.0.0 + */ +interface ISystemTagManagerFactory { + + /** + * Constructor for the system tag manager factory + * + * @param IServerContainer $serverContainer server container + * @since 9.0.0 + */ + public function __construct(IServerContainer $serverContainer); + + /** + * creates and returns an instance of the system tag manager + * + * @return ISystemTagManager + * @since 9.0.0 + */ + public function getManager(); + + /** + * creates and returns an instance of the system tag object + * mapper + * + * @return ISystemTagObjectMapper + * @since 9.0.0 + */ + public function getObjectMapper(); +} -- cgit v1.2.3