Proposal::setPayementMethod()   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
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
4
namespace Dolibarr\Client\Domain\Proposal;
5
6
use DateTimeInterface;
7
use JMS\Serializer\Annotation as JMS;
8
use Webmozart\Assert\Assert;
9
10
/**
11
 * @author Laurent De Coninck <[email protected]>
12
 */
13
class Proposal
14
{
15
16
    /**
17
     * @var int
18
     *
19
     * @JMS\Type("int")
20
     * @JMS\SerializedName("socid")
21
     */
22
    private $companyId;
23
24
    /**
25
     * @var int
26
     *
27
     * @JMS\Type("int")
28
     * @JMS\SerializedName("contactid")
29
     */
30
    private $contactId;
31
32
    /**
33
     * Timestamp of the delivery date.
34
     *
35
     * @JMS\Type("DateTime<'Y-m-d'>")
36
     * @JMS\SerializedName("date_livraison")
37
     *
38
     * @var \DateTimeInterface
39
     */
40
    private $deliveryDate;
41
42
    /**
43
     * @JMS\Type("int")
44
     * @JMS\SerializedName("user_author_id")
45
     *
46
     * @var
47
     */
48
    private $authorId;
49
50
    /**
51
     * @var int
52
     *
53
     * @JMS\Type("int")
54
     * @JMS\SerializedName("demand_reason_id")
55
     */
56
    private $origin;
57
58
    /**
59
     * @JMS\Type("int")
60
     * @JMS\SerializedName("cond_reglement_id")
61
     *
62
     * @var int
63
     */
64
    private $salesCondition;
65
66
    /**
67
     * @JMS\Type("int")
68
     * @JMS\SerializedName("mode_reglement_id")
69
     *
70
     * @var int
71
     */
72
    private $payementMethod;
73
74
    /**
75
     * @var \DateTimeInterface
76
     *
77
     * @JMS\Type("DateTime<'Y-m-d'>")
78
     * @JMS\SerializedName("date")
79
     */
80
    private $date;
81
82
    /**
83
     * @var string
84
     *
85
     * @JMS\Type("string")
86
     * @JMS\SerializedName("note_public")
87
     */
88
    private $note;
89
90
    /**
91
     * @param int            $companyId
92
     * @param \DateTime|null $date
93
     *
94
     * @throws \Exception
95
     */
96
    public function __construct($companyId, \DateTime $date = null)
97
    {
98
        Assert::integer($companyId);
99
        Assert::greaterThan($companyId, 0);
100
101
        if ($date === null) {
102
            $date = new \DateTime();
103
        }
104
105
        $this->date = $date;
106
        $this->companyId = $companyId;
107
    }
108
109
    /**
110
     * @return int
111
     */
112
    public function getCompanyId()
113
    {
114
        return $this->companyId;
115
    }
116
117
    /**
118
     * @param int $companyId
119
     */
120
    public function setCompanyId($companyId)
121
    {
122
        $this->companyId = $companyId;
123
    }
124
125
    /**
126
     * @return int
127
     */
128
    public function getContactId()
129
    {
130
        return $this->contactId;
131
    }
132
133
    /**
134
     * @param int $contactId
135
     */
136
    public function setContactId($contactId)
137
    {
138
        $this->contactId = $contactId;
139
    }
140
141
    /**
142
     * @return \DateTimeInterface
143
     */
144
    public function getDeliveryDate()
145
    {
146
        return $this->deliveryDate;
147
    }
148
149
    /**
150
     * @param DateTimeInterface $deliveryDate
151
     */
152
    public function setDeliveryDate(\DateTimeInterface $deliveryDate)
153
    {
154
        $this->deliveryDate = $deliveryDate;
155
    }
156
157
    /**
158
     * @return mixed
159
     */
160
    public function getAuthorId()
161
    {
162
        return $this->authorId;
163
    }
164
165
    /**
166
     * @param mixed $authorId
167
     */
168
    public function setAuthorId($authorId)
169
    {
170
        $this->authorId = $authorId;
171
    }
172
173
    /**
174
     * @return int
175
     */
176
    public function getOrigin()
177
    {
178
        return $this->origin;
179
    }
180
181
    /**
182
     * @param int $origin
183
     */
184
    public function setOrigin($origin)
185
    {
186
        $this->origin = $origin;
187
    }
188
189
    /**
190
     * @return int
191
     */
192
    public function getSalesCondition()
193
    {
194
        return $this->salesCondition;
195
    }
196
197
    /**
198
     * @param int $salesCondition
199
     */
200
    public function setSalesCondition($salesCondition)
201
    {
202
        $this->salesCondition = $salesCondition;
203
    }
204
205
    /**
206
     * @return int
207
     */
208
    public function getPayementMethod()
209
    {
210
        return $this->payementMethod;
211
    }
212
213
    /**
214
     * @param int $payementMethod
215
     */
216
    public function setPayementMethod($payementMethod)
217
    {
218
        $this->payementMethod = $payementMethod;
219
    }
220
221
    /**
222
     * @return \DateTimeInterface
223
     */
224
    public function getDate()
225
    {
226
        return $this->date;
227
    }
228
229
    /**
230
     * @param \DateTimeInterface $date
231
     */
232
    public function setDate($date)
233
    {
234
        $this->date = $date;
235
    }
236
237
    /**
238
     * @return string
239
     */
240
    public function getNote()
241
    {
242
        return $this->note;
243
    }
244
245
    /**
246
     * @param string $note
247
     */
248
    public function setNote($note)
249
    {
250
        $this->note = $note;
251
    }
252
}
253