mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-12-15 23:53:38 +08:00
26 lines
614 B
PHP
26 lines
614 B
PHP
<?php
|
|
|
|
namespace BookStack\Exports\ZipExports\Models;
|
|
|
|
use BookStack\Exports\ZipExports\ZipExportFiles;
|
|
use BookStack\Uploads\Image;
|
|
|
|
class ZipExportImage extends ZipExportModel
|
|
{
|
|
public ?int $id = null;
|
|
public string $name;
|
|
public string $file;
|
|
public string $type;
|
|
|
|
public static function fromModel(Image $model, ZipExportFiles $files): self
|
|
{
|
|
$instance = new self();
|
|
$instance->id = $model->id;
|
|
$instance->name = $model->name;
|
|
$instance->type = $model->type;
|
|
$instance->file = $files->referenceForImage($model);
|
|
|
|
return $instance;
|
|
}
|
|
}
|