Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 31 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
MailTemplateProvider | |
0.00% |
0 / 31 |
|
0.00% |
0 / 5 |
72 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getProviderId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getTemplate | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
getTemplates | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
loadTemplates | |
0.00% |
0 / 23 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace BO\Zmsdb\Helper; |
4 | |
5 | class MailTemplateProvider |
6 | { |
7 | protected $templates = false; |
8 | |
9 | public function __construct($process) |
10 | { |
11 | $this->process = $process; |
12 | } |
13 | |
14 | protected function getProviderId() |
15 | { |
16 | return $this->process->scope->provider['id']; |
17 | } |
18 | |
19 | public function getTemplate($templateName) |
20 | { |
21 | if (!$this->templates) { |
22 | $this->loadTemplates(); |
23 | } |
24 | return $this->templates[$templateName]; |
25 | } |
26 | |
27 | public function getTemplates() |
28 | { |
29 | if (!$this->templates) { |
30 | $this->loadTemplates(); |
31 | } |
32 | return $this->templates; |
33 | } |
34 | |
35 | protected function loadTemplates() |
36 | { |
37 | |
38 | $this->templates = array( |
39 | 'notification_appointment.twig' => "template is empty", |
40 | 'notification_confirmation.twig' => "template is empty", |
41 | 'notification_headsup.twig' => "template is empty", |
42 | 'notification_reminder.twig' => "template is empty", |
43 | 'notification_pickup.twig' => "template is empty", |
44 | 'notification_deleted.twig' => "template is empty", |
45 | 'mail_queued.twig' => "template is empty", |
46 | 'mail_confirmation.twig' => "template is empty", |
47 | 'mail_reminder.twig' => "template is empty", |
48 | 'mail_pickup.twig' => "template is empty", |
49 | 'mail_delete.twig' => "template is empty", |
50 | 'mail_survey.twig' => "template is empty", |
51 | 'mail_processlist_overview.twig' => "template is empty", |
52 | 'mail_preconfirmed.twig' => "template is empty", |
53 | 'icsappointment.twig' => "template is empty", |
54 | 'icsappointment_delete.twig' => "template is empty", |
55 | 'mail_admin_delete.twig' => "template is empty", |
56 | 'mail_admin_update.twig' => "template is empty", |
57 | ); |
58 | |
59 | |
60 | $result = (new \BO\Zmsdb\MailTemplates())->readCustomizedListForProvider($this->getProviderId()); |
61 | foreach ($result as $templateObject) { |
62 | $this->templates[$templateObject['name']] = $templateObject['value']; |
63 | } |
64 | } |
65 | } |