1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/tests/Feature/PdfMaker/PdfMaker.php
2020-07-13 17:49:28 +02:00

48 lines
764 B
PHP

<?php
namespace Tests\Feature\PdfMaker;
class PdfMaker
{
use PdfMakerUtilities;
protected $data;
public $design;
public $html;
public $document;
private $xpath;
public function __construct(array $data)
{
$this->data = $data;
}
public function design(string $design)
{
$this->design = new $design();
$this->initializeDomDocument();
return $this;
}
public function build()
{
// $raw = $this->design->html();
$this->updateElementProperties($this->data['template']);
$this->updateVariables($this->data['variables']);
return $this;
}
public function getCompiledHTML()
{
return $this->document->saveHTML();
}
}