Implement base design class & remove design interface
This commit is contained in:
parent
35af6e137a
commit
17858dae45
2 changed files with 12 additions and 24 deletions
|
|
@ -12,11 +12,11 @@
|
|||
|
||||
namespace App\Services\PdfMaker\Designs;
|
||||
|
||||
use App\Services\PdfMaker\Designs\Utilities\BaseDesign;
|
||||
use App\Services\PdfMaker\Designs\Utilities\BuildTableHeader;
|
||||
use App\Services\PdfMaker\Designs\Utilities\DesignInterface;
|
||||
use App\Utils\Traits\MakesInvoiceValues;
|
||||
|
||||
class Plain implements DesignInterface
|
||||
class Plain extends BaseDesign
|
||||
{
|
||||
use MakesInvoiceValues, BuildTableHeader;
|
||||
|
||||
|
|
@ -39,17 +39,6 @@ class Plain implements DesignInterface
|
|||
);
|
||||
}
|
||||
|
||||
public function setup(): void
|
||||
{
|
||||
if (isset($this->context['client'])) {
|
||||
$this->client = $this->context['client'];
|
||||
}
|
||||
|
||||
if (isset($this->context['invoice'])) {
|
||||
$this->invoice = $this->context['invoice'];
|
||||
}
|
||||
}
|
||||
|
||||
public function elements(array $context): array
|
||||
{
|
||||
$this->context = $context;
|
||||
|
|
|
|||
|
|
@ -12,17 +12,16 @@
|
|||
|
||||
namespace App\Services\PdfMaker\Designs\Utilities;
|
||||
|
||||
interface DesignInterface
|
||||
class BaseDesign
|
||||
{
|
||||
public function html(): ?string;
|
||||
public function setup(): void
|
||||
{
|
||||
if (isset($this->context['client'])) {
|
||||
$this->client = $this->context['client'];
|
||||
}
|
||||
|
||||
public function setup(): void;
|
||||
|
||||
public function elements(array $context): array;
|
||||
|
||||
public function productTable(): array;
|
||||
|
||||
public function buildTableHeader(): array;
|
||||
|
||||
public function buildTableBody(): array;
|
||||
if (isset($this->context['invoice'])) {
|
||||
$this->invoice = $this->context['invoice'];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue