2021-01-12 05:28:04 -05:00
|
|
|
<?php
|
2021-06-04 15:52:51 -04:00
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2021-01-12 05:28:04 -05:00
|
|
|
*/
|
|
|
|
|
namespace OCP\Files\Template;
|
|
|
|
|
|
|
|
|
|
use OCP\EventDispatcher\Event;
|
|
|
|
|
use OCP\Files\File;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @since 21.0.0
|
|
|
|
|
*/
|
2021-01-28 05:50:40 -05:00
|
|
|
class FileCreatedFromTemplateEvent extends Event {
|
2021-01-12 05:28:04 -05:00
|
|
|
private $template;
|
|
|
|
|
private $target;
|
2024-07-24 15:59:37 -04:00
|
|
|
private $templateFields;
|
2021-01-12 05:28:04 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param File|null $template
|
|
|
|
|
* @param File $target
|
|
|
|
|
* @since 21.0.0
|
|
|
|
|
*/
|
2024-07-24 15:59:37 -04:00
|
|
|
public function __construct(?File $template, File $target, array $templateFields) {
|
2021-01-12 05:28:04 -05:00
|
|
|
$this->template = $template;
|
|
|
|
|
$this->target = $target;
|
2024-07-24 15:59:37 -04:00
|
|
|
$this->templateFields = $templateFields;
|
2021-01-12 05:28:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return File|null
|
|
|
|
|
* @since 21.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getTemplate(): ?File {
|
|
|
|
|
return $this->template;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-24 15:59:37 -04:00
|
|
|
/**
|
|
|
|
|
* @return array
|
|
|
|
|
* @since 30.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getTemplateFields(): array {
|
|
|
|
|
return $this->templateFields;
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-12 05:28:04 -05:00
|
|
|
/**
|
|
|
|
|
* @return File
|
|
|
|
|
* @since 21.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function getTarget(): File {
|
|
|
|
|
return $this->target;
|
|
|
|
|
}
|
|
|
|
|
}
|