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 | protected $process; |
| 9 | |
| 10 | public function __construct($process) |
| 11 | { |
| 12 | $this->process = $process; |
| 13 | } |
| 14 | |
| 15 | protected function getProviderId() |
| 16 | { |
| 17 | return $this->process->scope->provider['id']; |
| 18 | } |
| 19 | |
| 20 | public function getTemplate($templateName) |
| 21 | { |
| 22 | if (!$this->templates) { |
| 23 | $this->loadTemplates(); |
| 24 | } |
| 25 | return $this->templates[$templateName]; |
| 26 | } |
| 27 | |
| 28 | public function getTemplates() |
| 29 | { |
| 30 | if (!$this->templates) { |
| 31 | $this->loadTemplates(); |
| 32 | } |
| 33 | return $this->templates; |
| 34 | } |
| 35 | |
| 36 | protected function loadTemplates() |
| 37 | { |
| 38 | |
| 39 | $this->templates = array( |
| 40 | 'notification_appointment.twig' => "template is empty", |
| 41 | 'notification_confirmation.twig' => "template is empty", |
| 42 | 'notification_headsup.twig' => "template is empty", |
| 43 | 'notification_reminder.twig' => "template is empty", |
| 44 | 'notification_pickup.twig' => "template is empty", |
| 45 | 'notification_deleted.twig' => "template is empty", |
| 46 | 'mail_queued.twig' => "template is empty", |
| 47 | 'mail_confirmation.twig' => "template is empty", |
| 48 | 'mail_reminder.twig' => "template is empty", |
| 49 | 'mail_pickup.twig' => "template is empty", |
| 50 | 'mail_delete.twig' => "template is empty", |
| 51 | 'mail_survey.twig' => "template is empty", |
| 52 | 'mail_processlist_overview.twig' => "template is empty", |
| 53 | 'mail_preconfirmed.twig' => "template is empty", |
| 54 | 'icsappointment.twig' => "template is empty", |
| 55 | 'icsappointment_delete.twig' => "template is empty", |
| 56 | 'mail_admin_delete.twig' => "template is empty", |
| 57 | 'mail_admin_update.twig' => "template is empty", |
| 58 | ); |
| 59 | |
| 60 | |
| 61 | $result = (new \BO\Zmsdb\MailTemplates())->readCustomizedListForProvider($this->getProviderId()); |
| 62 | foreach ($result as $templateObject) { |
| 63 | $this->templates[$templateObject['name']] = $templateObject['value']; |
| 64 | } |
| 65 | } |
| 66 | } |