FileCreatedFromTemplateEvent.php 1017 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Files\Template;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\Files\File;
  10. /**
  11. * @since 21.0.0
  12. */
  13. class FileCreatedFromTemplateEvent extends Event {
  14. private $template;
  15. private $target;
  16. private $templateFields;
  17. /**
  18. * @param File|null $template
  19. * @param File $target
  20. * @since 21.0.0
  21. */
  22. public function __construct(?File $template, File $target, array $templateFields) {
  23. $this->template = $template;
  24. $this->target = $target;
  25. $this->templateFields = $templateFields;
  26. }
  27. /**
  28. * @return File|null
  29. * @since 21.0.0
  30. */
  31. public function getTemplate(): ?File {
  32. return $this->template;
  33. }
  34. /**
  35. * @return array
  36. * @since 30.0.0
  37. */
  38. public function getTemplateFields(): array {
  39. return $this->templateFields;
  40. }
  41. /**
  42. * @return File
  43. * @since 21.0.0
  44. */
  45. public function getTarget(): File {
  46. return $this->target;
  47. }
  48. }