2024-10-21 02:56:56 +08:00
|
|
|
<?php
|
|
|
|
|
2024-10-23 17:48:26 +08:00
|
|
|
namespace BookStack\Exports\ZipExports\Models;
|
2024-10-21 02:56:56 +08:00
|
|
|
|
2024-10-23 17:48:26 +08:00
|
|
|
use BookStack\Exports\ZipExports\ZipExportFiles;
|
2024-10-21 20:59:15 +08:00
|
|
|
use BookStack\Uploads\Image;
|
2024-10-21 02:56:56 +08:00
|
|
|
|
2024-10-21 19:13:41 +08:00
|
|
|
class ZipExportImage extends ZipExportModel
|
2024-10-21 02:56:56 +08:00
|
|
|
{
|
2024-10-21 20:59:15 +08:00
|
|
|
public ?int $id = null;
|
2024-10-21 02:56:56 +08:00
|
|
|
public string $name;
|
|
|
|
public string $file;
|
2024-10-21 20:59:15 +08:00
|
|
|
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;
|
|
|
|
}
|
2024-10-21 02:56:56 +08:00
|
|
|
}
|