mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 05:24:29 -04:00
Implement base design class & remove design interface
This commit is contained in:
parent
35af6e137a
commit
17858dae45
@ -12,11 +12,11 @@
|
|||||||
|
|
||||||
namespace App\Services\PdfMaker\Designs;
|
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\BuildTableHeader;
|
||||||
use App\Services\PdfMaker\Designs\Utilities\DesignInterface;
|
|
||||||
use App\Utils\Traits\MakesInvoiceValues;
|
use App\Utils\Traits\MakesInvoiceValues;
|
||||||
|
|
||||||
class Plain implements DesignInterface
|
class Plain extends BaseDesign
|
||||||
{
|
{
|
||||||
use MakesInvoiceValues, BuildTableHeader;
|
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
|
public function elements(array $context): array
|
||||||
{
|
{
|
||||||
$this->context = $context;
|
$this->context = $context;
|
||||||
|
@ -12,17 +12,16 @@
|
|||||||
|
|
||||||
namespace App\Services\PdfMaker\Designs\Utilities;
|
namespace App\Services\PdfMaker\Designs\Utilities;
|
||||||
|
|
||||||
interface DesignInterface
|
class BaseDesign
|
||||||
{
|
{
|
||||||
public function html(): ?string;
|
public function setup(): void
|
||||||
|
{
|
||||||
public function setup(): void;
|
if (isset($this->context['client'])) {
|
||||||
|
$this->client = $this->context['client'];
|
||||||
public function elements(array $context): array;
|
}
|
||||||
|
|
||||||
public function productTable(): array;
|
if (isset($this->context['invoice'])) {
|
||||||
|
$this->invoice = $this->context['invoice'];
|
||||||
public function buildTableHeader(): array;
|
}
|
||||||
|
}
|
||||||
public function buildTableBody(): array;
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user