ExampleNotifierService   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 65
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getRecipientSpecificNewsletterSubject() 0 3 1
A getRecipientVarsForNotificationsEmail() 0 6 1
A getRecipientSpecificNotificationsSubject() 0 3 1
A getRecipientSpecificNewsletterContentItems() 0 9 1
A getNonRecipientSpecificNewsletterContentItems() 0 9 1
1
<?php
2
3
namespace Azine\EmailBundle\Services;
4
5
use Azine\EmailBundle\Entity\RecipientInterface;
6
7
/**
8
 * This Service compiles and renders the emails to be sent.
9
 * This class is only an example. Implement your own!
10
 *
11
 * @codeCoverageIgnore
12
 *
13
 * @author Dominik Businger
14
 */
15
class ExampleNotifierService extends AzineNotifierService
16
{
17
    /**
18
     * (non-PHPdoc).
19
     *
20
     * @see Azine\EmailBundle\Services.AzineNotifierService::getRecipientVarsForNotificationsEmail()
21
     */
22
    protected function getRecipientVarsForNotificationsEmail(RecipientInterface $recipient)
23
    {
24
        $recipientParams = parent::getRecipientVarsForNotificationsEmail($recipient);
25
26
        // $recipientParams = array_merge($this->getSomeMoreRecipientParamsForTheNotificationEmail($recipient), $recipientParams);
27
        return $recipientParams;
28
    }
29
30
    /**
31
     * (non-PHPdoc).
32
     *
33
     * @see Azine\EmailBundle\Services.AzineNotifierService::getRecipientSpecificNotificationsSubject()
34
     */
35
    public function getRecipientSpecificNotificationsSubject($contentItems, RecipientInterface $recipient)
36
    {
37
        return parent::getRecipientSpecificNotificationsSubject($contentItems, $recipient);
38
    }
39
40
    /**
41
     * (non-PHPdoc).
42
     *
43
     * @see Azine\EmailBundle\Services.AzineNotifierService::getNonRecipientSpecificNewsletterContentItems()
44
     */
45
    protected function getNonRecipientSpecificNewsletterContentItems()
46
    {
47
        $contentItems = array();
48
49
        $templateParams = array('title' => 'foo bar');
50
        //$templateParams = array_merge($this->getSomeMoreParamsForTheNewsletter(), $templateParams);
51
        $contentItems[] = array('AcmeBundle:foo:barSameForAllRecipientsTemplate' => $templateParams);
52
53
        return $contentItems;
54
    }
55
56
    /**
57
     * (non-PHPdoc).
58
     *
59
     * @see Azine\EmailBundle\Services.AzineNotifierService::getRecipientSpecificNewsletterSubject()
60
     */
61
    public function getRecipientSpecificNewsletterSubject(array $generalContentItems, array $recipientContentItems, array $params, RecipientInterface $recipient, $locale)
62
    {
63
        return parent::getRecipientSpecificNewsletterSubject($generalContentItems, $recipientContentItems, $params, $recipient, $locale);
64
    }
65
66
    /**
67
     * (non-PHPdoc).
68
     *
69
     * @see Azine\EmailBundle\Services.AzineNotifierService::getRecipientSpecificNewsletterContentItems()
70
     */
71
    protected function getRecipientSpecificNewsletterContentItems(RecipientInterface $recipient)
72
    {
73
        $contentItems = array();
74
75
        $recipientSpecificTemplateParams = array('title' => 'foo bar');
76
        //$recipientSpecificTemplateParams = array_merge($this->getSomeMoreParamsForTheNewsletterForThisRecipient($recipient), $recipientSpecificTemplateParams);
77
        $contentItems[] = array('AcmeBundle:foo:barDifferentForEachRecipientTemplate' => $recipientSpecificTemplateParams);
78
79
        return $contentItems;
80
    }
81
}
82