1 | <?php |
||
18 | class TwigBuilder |
||
19 | { |
||
20 | /** |
||
21 | * @var \Twig_Environment |
||
22 | */ |
||
23 | protected $twig; |
||
24 | |||
25 | /** |
||
26 | * TwigBuilder constructor. |
||
27 | * @param array $options [optional] Recommended: 'cache' => '/dir/cache' |
||
28 | */ |
||
29 | 94 | public function __construct($options = []) |
|
33 | |||
34 | /** |
||
35 | * Get Content XML from template. |
||
36 | * |
||
37 | * @param string $template |
||
38 | * @param object $doc |
||
39 | * @return string |
||
40 | */ |
||
41 | 94 | public function render($template, $doc) |
|
49 | |||
50 | 94 | private function initTwig($options) |
|
61 | |||
62 | /** |
||
63 | * Validate Entity. |
||
64 | * |
||
65 | * @param object $entity |
||
66 | * @throws ValidationException |
||
67 | */ |
||
68 | 94 | public function validate($entity) |
|
80 | } |