mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-02-25 00:14:10 +08:00

Some checks failed
analyse-php / build (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-migrations / build (8.1) (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-php / build (8.1) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
26 lines
601 B
PHP
26 lines
601 B
PHP
<?php
|
|
|
|
namespace BookStack\Exports\ZipExportModels;
|
|
|
|
use BookStack\Exports\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;
|
|
}
|
|
}
|