Skip to content

Commit

Permalink
fixup! files: Create files from template API
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr committed Jan 20, 2021
1 parent a899278 commit ba56348
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/public/Files/Template/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,42 @@

use OCP\Files\File;

/**
* @since 21.0.0
*/
class Template implements \JsonSerializable {
protected $templateType;
protected $templateId;
protected $file;
protected $hasPreview = false;
protected $previewUrl;

/**
* @since 21.0.0
*/
final public function __construct(string $templateType, string $templateId, File $file) {
$this->templateType = $templateType;
$this->templateId = $templateId;
$this->file = $file;
}

/**
* @since 21.0.0
*/
final public function setCustomPreviewUrl(string $previewUrl): void {
$this->previewUrl = $previewUrl;
}

/**
* @since 21.0.0
*/
final public function setHasPreview(bool $hasPreview): void {
$this->hasPreview = $hasPreview;
}

/**
* @since 21.0.0
*/
final public function jsonSerialize() {
return [
'templateType' => $this->templateType,
Expand Down

0 comments on commit ba56348

Please sign in to comment.