FileCreatedFromTemplateEvent.php 797 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. /**
  17. * @param File|null $template
  18. * @param File $target
  19. * @since 21.0.0
  20. */
  21. public function __construct(?File $template, File $target) {
  22. $this->template = $template;
  23. $this->target = $target;
  24. }
  25. /**
  26. * @return File|null
  27. * @since 21.0.0
  28. */
  29. public function getTemplate(): ?File {
  30. return $this->template;
  31. }
  32. /**
  33. * @return File
  34. * @since 21.0.0
  35. */
  36. public function getTarget(): File {
  37. return $this->target;
  38. }
  39. }