diff options
author | Joas Schilling <coding@schilljs.com> | 2016-11-04 13:33:33 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-11-16 11:25:45 +0300 |
commit | b2248efd75e1a1b56624a12d37f4828ea30d32f8 (patch) | |
tree | ae5bad619fbff3a4e7c2529fde7f9ed7b075feaf /lib/public/Activity | |
parent | 72f0d9981eca7b1be5832ea2d1a0cbd9526e85a4 (diff) |
Allow to register Providers
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/public/Activity')
-rw-r--r-- | lib/public/Activity/IManager.php | 13 | ||||
-rw-r--r-- | lib/public/Activity/IProvider.php | 39 |
2 files changed, 52 insertions, 0 deletions
diff --git a/lib/public/Activity/IManager.php b/lib/public/Activity/IManager.php index ded83bcc922..48071729ed1 100644 --- a/lib/public/Activity/IManager.php +++ b/lib/public/Activity/IManager.php @@ -145,6 +145,19 @@ interface IManager { public function getSettings(); /** + * @param string $provider Class must implement OCA\Activity\IProvider + * @return void + * @since 9.2.0 + */ + public function registerProvider($provider); + + /** + * @return IProvider[] + * @since 9.2.0 + */ + public function getProviders(); + + /** * @param string $id * @return ISetting * @throws \InvalidArgumentException when the setting was not found diff --git a/lib/public/Activity/IProvider.php b/lib/public/Activity/IProvider.php new file mode 100644 index 00000000000..6e4b9b16271 --- /dev/null +++ b/lib/public/Activity/IProvider.php @@ -0,0 +1,39 @@ +<?php +/** + * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * 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 + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCP\Activity; + +/** + * Interface IProvider + * + * @package OCP\Activity + * @since 9.2.0 + */ +interface IProvider { + /** + * @param IEvent $event + * @param IEvent|null $previousEvent + * @return IEvent + * @throws \InvalidArgumentException + * @since 9.2.0 + */ + public function parse(IEvent $event, IEvent $previousEvent = null); +} |