ManagerFactory.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. * @author Thomas Müller <thomas.mueller@tmit.eu>
  9. * @author Vincent Petry <vincent@nextcloud.com>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OC\Comments;
  27. use OCP\Comments\ICommentsManager;
  28. use OCP\Comments\ICommentsManagerFactory;
  29. use OCP\IServerContainer;
  30. class ManagerFactory implements ICommentsManagerFactory {
  31. /**
  32. * Server container
  33. *
  34. * @var IServerContainer
  35. */
  36. private $serverContainer;
  37. /**
  38. * Constructor for the comments manager factory
  39. *
  40. * @param IServerContainer $serverContainer server container
  41. */
  42. public function __construct(IServerContainer $serverContainer) {
  43. $this->serverContainer = $serverContainer;
  44. }
  45. /**
  46. * creates and returns an instance of the ICommentsManager
  47. *
  48. * @return ICommentsManager
  49. * @since 9.0.0
  50. */
  51. public function getManager() {
  52. return $this->serverContainer->get(Manager::class);
  53. }
  54. }