Completed
Push — master ( 8edee4...0135c2 )
by Marin
04:35
created

Recipient::getTimeLastModified()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Anorgan\Onfleet;
4
5
/**
6
 * Class Recipient
7
 * @package Anorgan\Onfleet
8
 */
9
class Recipient extends Entity
10
{
11
    protected $name;
12
    protected $phone;
13
    protected $notes;
14
    protected $skipSMSNotifications = false;
15
    protected $metadata             = [];
16
    protected $organization;
17
    protected $timeCreated;
18
    protected $timeLastModified;
19
20
    protected $endpoint = 'recipients';
21
22
    protected static $properties = [
23
        'id',
24
        'name',
25
        'phone',
26
        'notes',
27
        'skipSMSNotifications',
28
        'metadata',
29
        'organization',
30
        'timeCreated',
31
        'timeLastModified',
32
    ];
33
34
    /**
35
     * @return string
36
     */
37
    public function getName()
38
    {
39
        return $this->name;
40
    }
41
42
    /**
43
     * @param string $name
44
     */
45
    public function setName($name)
46
    {
47
        $this->name = $name;
48
    }
49
50
    /**
51
     * @return string
52
     */
53
    public function getPhone()
54
    {
55
        return $this->phone;
56
    }
57
58
    /**
59
     * @param string $phone
60
     */
61
    public function setPhone($phone)
62
    {
63
        $this->phone = $phone;
64
    }
65
66
    /**
67
     * @return string
68
     */
69
    public function getNotes()
70
    {
71
        return $this->notes;
72
    }
73
74
    /**
75
     * @param string $notes
76
     */
77
    public function setNotes($notes)
78
    {
79
        $this->notes = $notes;
80
    }
81
82
    /**
83
     * @return boolean
84
     */
85
    public function isSMSNotificationSkipped(): bool
86
    {
87
        return $this->skipSMSNotifications;
88
    }
89
90
    /**
91
     * @param boolean $state
92
     */
93
    public function skipSMSNotifications($state)
94
    {
95
        $this->skipSMSNotifications = $state;
96
    }
97
98
    /**
99
     * @return array
100
     */
101
    public function getMetadata(): array
102
    {
103
        return $this->metadata;
104
    }
105
106
    /**
107
     * @return string
108
     */
109
    public function getOrganization()
110
    {
111
        return $this->organization;
112
    }
113
114
    /**
115
     * @return \DateTime
116
     */
117
    public function getTimeCreated()
118
    {
119
        return $this->toDateTime($this->timeCreated);
120
    }
121
122
    /**
123
     * @return \DateTime
124
     */
125
    public function getTimeLastModified()
126
    {
127
        return $this->toDateTime($this->timeLastModified);
128
    }
129
130
    /**
131
     * @throws \BadMethodCallException
132
     */
133
    public function delete()
134
    {
135
        throw new \BadMethodCallException('Recipient can not be deleted');
136
    }
137
}
138