ManagerFactory.php 909 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OC\Comments;
  8. use OCP\Comments\ICommentsManager;
  9. use OCP\Comments\ICommentsManagerFactory;
  10. use OCP\IServerContainer;
  11. class ManagerFactory implements ICommentsManagerFactory {
  12. /**
  13. * Server container
  14. *
  15. * @var IServerContainer
  16. */
  17. private $serverContainer;
  18. /**
  19. * Constructor for the comments manager factory
  20. *
  21. * @param IServerContainer $serverContainer server container
  22. */
  23. public function __construct(IServerContainer $serverContainer) {
  24. $this->serverContainer = $serverContainer;
  25. }
  26. /**
  27. * creates and returns an instance of the ICommentsManager
  28. *
  29. * @return ICommentsManager
  30. * @since 9.0.0
  31. */
  32. public function getManager() {
  33. return $this->serverContainer->get(Manager::class);
  34. }
  35. }