MailMotorSubscribedEvent::getInterests()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace MailMotor\Bundle\MailMotorBundle\Event;
4
5
use Symfony\Contracts\EventDispatcher\Event;
6
7
/**
8
 * This class is in fact an immutable event class holding all the data
9
 * that could be needed by event subscribers on the MailMotorSubscribedEvent
10
 *
11
 * @author Jeroen Desloovere <[email protected]>
12
 */
13
class MailMotorSubscribedEvent extends Event
14
{
15
    const EVENT_NAME = 'mail_motor_event.subscribed';
16
17
    /** @var boolean */
18
    protected $hasDoubleOptin;
19
20
    /** @var string */
21
    protected $email;
22
23
    /** @var string */
24
    protected $language;
25
26
    /** @var string */
27
    protected $listId;
28
29
    /** @var array */
30
    protected $mergeFields;
31
32
    /** @var array */
33
    protected $interests;
34
35
    public function __construct(
36
        string $email,
37
        string $listId,
38
        string $language,
39
        array $mergeFields,
40
        array $interests,
41
        bool $hasDoubleOptin
42
    ) {
43
        $this->email = $email;
44
        $this->listId = $listId;
45
        $this->language = $language;
46
        $this->mergeFields = $mergeFields;
47
        $this->interests = $interests;
48
        $this->hasDoubleOptin = $hasDoubleOptin;
49
    }
50
51
    public function getEmail(): string
52
    {
53
        return $this->email;
54
    }
55
56
    public function getInterests(): array
57
    {
58
        return $this->interests;
59
    }
60
61
    public function getLanguage(): string
62
    {
63
        return $this->language;
64
    }
65
66
    public function getListId(): string
67
    {
68
        return $this->listId;
69
    }
70
71
    public function getMergeFields(): array
72
    {
73
        return $this->mergeFields;
74
    }
75
76
    public function hasDoubleOptin(): bool
77
    {
78
        return $this->hasDoubleOptin;
79
    }
80
}
81