26 lines
617 B
PHP
26 lines
617 B
PHP
<?php
|
|
|
|
namespace App\Services\Export;
|
|
|
|
use App\Models\Study;
|
|
use App\Models\StudyReport;
|
|
|
|
abstract class ExportDocumentBase implements IExportDocument
|
|
{
|
|
public function __construct(protected readonly Study $study, protected readonly StudyReport $report) {}
|
|
|
|
public function make(Study $study, StudyReport $report): string
|
|
{
|
|
return $this->handle();
|
|
}
|
|
|
|
abstract protected function handle(): string;
|
|
|
|
abstract protected function getExtension(): string;
|
|
|
|
protected function filename(): string
|
|
{
|
|
return $this->report->accession_number . '.' . $this->getExtension();
|
|
}
|
|
}
|