1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace OroCRM\Bundle\MagentoBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Doctrine\Common\Collections\Collection; |
7
|
|
|
use Doctrine\Common\Collections\ArrayCollection; |
8
|
|
|
|
9
|
|
|
use Oro\Bundle\OrganizationBundle\Entity\Organization; |
10
|
|
|
use Oro\Bundle\UserBundle\Entity\User; |
11
|
|
|
use Oro\Bundle\WorkflowBundle\Entity\WorkflowItem; |
12
|
|
|
use Oro\Bundle\WorkflowBundle\Entity\WorkflowStep; |
13
|
|
|
use Oro\Bundle\LocaleBundle\Model\FirstNameInterface; |
14
|
|
|
use Oro\Bundle\LocaleBundle\Model\LastNameInterface; |
15
|
|
|
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\Config; |
16
|
|
|
use Oro\Bundle\EntityConfigBundle\Metadata\Annotation\ConfigField; |
17
|
|
|
|
18
|
|
|
use OroCRM\Bundle\MagentoBundle\Model\ExtendCart; |
19
|
|
|
use OroCRM\Bundle\SalesBundle\Entity\Opportunity; |
20
|
|
|
use OroCRM\Bundle\ChannelBundle\Model\ChannelAwareInterface; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @SuppressWarnings(PHPMD.ExcessivePublicCount) |
24
|
|
|
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity) |
25
|
|
|
* @SuppressWarnings(PHPMD.TooManyFields) |
26
|
|
|
* |
27
|
|
|
* @package OroCRM\Bundle\OroCRMMagentoBundle\Entity |
28
|
|
|
* @ORM\Entity(repositoryClass="OroCRM\Bundle\MagentoBundle\Entity\Repository\CartRepository") |
29
|
|
|
* @ORM\HasLifecycleCallbacks |
30
|
|
|
* @ORM\Table(name="orocrm_magento_cart", |
31
|
|
|
* indexes={ |
32
|
|
|
* @ORM\Index(name="magecart_origin_idx", columns={"origin_id"}), |
33
|
|
|
* @ORM\Index(name="magecart_updated_idx",columns={"updatedAt"}) |
34
|
|
|
* }, |
35
|
|
|
* uniqueConstraints={ |
36
|
|
|
* @ORM\UniqueConstraint(name="unq_cart_origin_id_channel_id", columns={"origin_id", "channel_id"}) |
37
|
|
|
* } |
38
|
|
|
* ) |
39
|
|
|
* @Config( |
40
|
|
|
* routeView="orocrm_magento_cart_view", |
41
|
|
|
* defaultValues={ |
42
|
|
|
* "entity"={ |
43
|
|
|
* "icon"="icon-shopping-cart" |
44
|
|
|
* }, |
45
|
|
|
* "ownership"={ |
46
|
|
|
* "owner_type"="USER", |
47
|
|
|
* "owner_field_name"="owner", |
48
|
|
|
* "owner_column_name"="user_owner_id", |
49
|
|
|
* "organization_field_name"="organization", |
50
|
|
|
* "organization_column_name"="organization_id" |
51
|
|
|
* }, |
52
|
|
|
* "security"={ |
53
|
|
|
* "type"="ACL", |
54
|
|
|
* "group_name"="" |
55
|
|
|
* }, |
56
|
|
|
* "form"={ |
57
|
|
|
* "grid_name"="magento-cart-grid", |
58
|
|
|
* }, |
59
|
|
|
* "workflow"={ |
60
|
|
|
* "active_workflow"="b2c_flow_abandoned_shopping_cart" |
61
|
|
|
* }, |
62
|
|
|
* "grid"={ |
63
|
|
|
* "default"="magento-cart-grid", |
64
|
|
|
* "context"="magento-cart-for-context-grid" |
65
|
|
|
* }, |
66
|
|
|
* "tag"={ |
67
|
|
|
* "enabled"=true |
68
|
|
|
* } |
69
|
|
|
* } |
70
|
|
|
* ) |
71
|
|
|
*/ |
72
|
|
|
class Cart extends ExtendCart implements |
73
|
|
|
ChannelAwareInterface, |
74
|
|
|
FirstNameInterface, |
75
|
|
|
LastNameInterface, |
76
|
|
|
OriginAwareInterface, |
77
|
|
|
IntegrationAwareInterface |
78
|
|
|
{ |
79
|
|
|
use IntegrationEntityTrait, OriginTrait, NamesAwareTrait, ChannelEntityTrait; |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @var CartItem[]|Collection |
83
|
|
|
* |
84
|
|
|
* @ORM\OneToMany(targetEntity="OroCRM\Bundle\MagentoBundle\Entity\CartItem", |
85
|
|
|
* mappedBy="cart", cascade={"all"}, orphanRemoval=true |
86
|
|
|
* ) |
87
|
|
|
* @ORM\OrderBy({"originId" = "DESC"}) |
88
|
|
|
* @ConfigField( |
89
|
|
|
* defaultValues={ |
90
|
|
|
* "importexport"={ |
91
|
|
|
* "full"=true |
92
|
|
|
* } |
93
|
|
|
* } |
94
|
|
|
* ) |
95
|
|
|
*/ |
96
|
|
|
protected $cartItems; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @ORM\ManyToOne(targetEntity="Customer", inversedBy="carts") |
100
|
|
|
* @ORM\JoinColumn(name="customer_id", referencedColumnName="id", onDelete="CASCADE") |
101
|
|
|
*/ |
102
|
|
|
protected $customer; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @var Store |
106
|
|
|
* |
107
|
|
|
* @ORM\ManyToOne(targetEntity="OroCRM\Bundle\MagentoBundle\Entity\Store") |
108
|
|
|
* @ORM\JoinColumn(name="store_id", referencedColumnName="id", onDelete="SET NULL") |
109
|
|
|
* @ConfigField( |
110
|
|
|
* defaultValues={ |
111
|
|
|
* "importexport"={ |
112
|
|
|
* "full"=false |
113
|
|
|
* } |
114
|
|
|
* } |
115
|
|
|
* ) |
116
|
|
|
*/ |
117
|
|
|
protected $store; |
118
|
|
|
|
119
|
|
|
/** |
120
|
|
|
* Total items qty |
121
|
|
|
* |
122
|
|
|
* @var float |
123
|
|
|
* |
124
|
|
|
* @ORM\Column(name="items_qty", type="float") |
125
|
|
|
*/ |
126
|
|
|
protected $itemsQty; |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* Items count |
130
|
|
|
* |
131
|
|
|
* @var integer |
132
|
|
|
* |
133
|
|
|
* @ORM\Column(name="items_count", type="integer", options={"unsigned"=true}) |
134
|
|
|
*/ |
135
|
|
|
protected $itemsCount; |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* @var string |
139
|
|
|
* |
140
|
|
|
* @ORM\Column(name="base_currency_code", type="string", length=32, nullable=false) |
141
|
|
|
*/ |
142
|
|
|
protected $baseCurrencyCode; |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @var string |
146
|
|
|
* |
147
|
|
|
* @ORM\Column(name="store_currency_code", type="string", length=32, nullable=false) |
148
|
|
|
*/ |
149
|
|
|
protected $storeCurrencyCode; |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* @var string |
153
|
|
|
* |
154
|
|
|
* @ORM\Column(name="quote_currency_code", type="string", length=32, nullable=false) |
155
|
|
|
*/ |
156
|
|
|
protected $quoteCurrencyCode; |
157
|
|
|
|
158
|
|
|
/** |
159
|
|
|
* @var float |
160
|
|
|
* |
161
|
|
|
* @ORM\Column(name="store_to_base_rate", type="float", nullable=false) |
162
|
|
|
*/ |
163
|
|
|
protected $storeToBaseRate; |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* @var float |
167
|
|
|
* |
168
|
|
|
* @ORM\Column(name="store_to_quote_rate", type="float", nullable=true) |
169
|
|
|
*/ |
170
|
|
|
protected $storeToQuoteRate; |
171
|
|
|
|
172
|
|
|
/** |
173
|
|
|
* @var string |
174
|
|
|
* |
175
|
|
|
* @ORM\Column(name="email", type="string", length=255, nullable=true) |
176
|
|
|
* @ConfigField( |
177
|
|
|
* defaultValues={ |
178
|
|
|
* "entity"={ |
179
|
|
|
* "contact_information"="email" |
180
|
|
|
* } |
181
|
|
|
* } |
182
|
|
|
* ) |
183
|
|
|
*/ |
184
|
|
|
protected $email; |
185
|
|
|
|
186
|
|
|
/** |
187
|
|
|
* @var string |
188
|
|
|
* |
189
|
|
|
* @ORM\Column(name="gift_message", type="string", length=255, nullable=true) |
190
|
|
|
*/ |
191
|
|
|
protected $giftMessage; |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* @var float |
195
|
|
|
* |
196
|
|
|
* @ORM\Column(name="is_guest", type="boolean") |
197
|
|
|
*/ |
198
|
|
|
protected $isGuest; |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* @var CartAddress $shippingAddress |
202
|
|
|
* |
203
|
|
|
* @ORM\ManyToOne(targetEntity="OroCRM\Bundle\MagentoBundle\Entity\CartAddress", cascade={"persist", "remove"}) |
204
|
|
|
* @ORM\JoinColumn(name="shipping_address_id", referencedColumnName="id", onDelete="SET NULL") |
205
|
|
|
* @ConfigField( |
206
|
|
|
* defaultValues={ |
207
|
|
|
* "importexport"={ |
208
|
|
|
* "full"=true |
209
|
|
|
* } |
210
|
|
|
* } |
211
|
|
|
* ) |
212
|
|
|
*/ |
213
|
|
|
protected $shippingAddress; |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* @var CartAddress $billingAddress |
217
|
|
|
* |
218
|
|
|
* @ORM\ManyToOne(targetEntity="OroCRM\Bundle\MagentoBundle\Entity\CartAddress", cascade={"persist", "remove"}) |
219
|
|
|
* @ORM\JoinColumn(name="billing_address_id", referencedColumnName="id", onDelete="SET NULL") |
220
|
|
|
* @ConfigField( |
221
|
|
|
* defaultValues={ |
222
|
|
|
* "importexport"={ |
223
|
|
|
* "full"=true |
224
|
|
|
* } |
225
|
|
|
* } |
226
|
|
|
* ) |
227
|
|
|
*/ |
228
|
|
|
protected $billingAddress; |
229
|
|
|
|
230
|
|
|
/** |
231
|
|
|
* @var string |
232
|
|
|
* |
233
|
|
|
* @ORM\Column(name="payment_details", type="string", length=255, nullable=true) |
234
|
|
|
*/ |
235
|
|
|
protected $paymentDetails; |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* @var CartStatus |
239
|
|
|
* |
240
|
|
|
* @ORM\ManyToOne(targetEntity="OroCRM\Bundle\MagentoBundle\Entity\CartStatus") |
241
|
|
|
* @ORM\JoinColumn(name="status_name", referencedColumnName="name", onDelete="SET NULL") |
242
|
|
|
* @ConfigField( |
243
|
|
|
* defaultValues={ |
244
|
|
|
* "importexport"={ |
245
|
|
|
* "full"=false |
246
|
|
|
* } |
247
|
|
|
* } |
248
|
|
|
* ) |
249
|
|
|
*/ |
250
|
|
|
protected $status; |
251
|
|
|
|
252
|
|
|
/** |
253
|
|
|
* @var Opportunity |
254
|
|
|
* |
255
|
|
|
* @ORM\ManyToOne(targetEntity="OroCRM\Bundle\SalesBundle\Entity\Opportunity") |
256
|
|
|
* @ORM\JoinColumn(name="opportunity_id", referencedColumnName="id", onDelete="SET NULL") |
257
|
|
|
*/ |
258
|
|
|
protected $opportunity; |
259
|
|
|
|
260
|
|
|
/** |
261
|
|
|
* @var string |
262
|
|
|
* |
263
|
|
|
* @ORM\Column(name="notes", type="text", nullable=true) |
264
|
|
|
*/ |
265
|
|
|
protected $notes; |
266
|
|
|
|
267
|
|
|
/** |
268
|
|
|
* @var WorkflowItem |
269
|
|
|
* |
270
|
|
|
* @ORM\OneToOne(targetEntity="Oro\Bundle\WorkflowBundle\Entity\WorkflowItem") |
271
|
|
|
* @ORM\JoinColumn(name="workflow_item_id", referencedColumnName="id", onDelete="SET NULL") |
272
|
|
|
*/ |
273
|
|
|
protected $workflowItem; |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* @var WorkflowStep |
277
|
|
|
* |
278
|
|
|
* @ORM\ManyToOne(targetEntity="Oro\Bundle\WorkflowBundle\Entity\WorkflowStep") |
279
|
|
|
* @ORM\JoinColumn(name="workflow_step_id", referencedColumnName="id", onDelete="SET NULL") |
280
|
|
|
*/ |
281
|
|
|
protected $workflowStep; |
282
|
|
|
|
283
|
|
|
/** |
284
|
|
|
* @var string |
285
|
|
|
* |
286
|
|
|
* @ORM\Column(name="status_message", type="string", length=255, nullable=true) |
287
|
|
|
*/ |
288
|
|
|
protected $statusMessage; |
289
|
|
|
|
290
|
|
|
/** |
291
|
|
|
* @var User |
292
|
|
|
* @ORM\ManyToOne(targetEntity="Oro\Bundle\UserBundle\Entity\User") |
293
|
|
|
* @ORM\JoinColumn(name="user_owner_id", referencedColumnName="id", onDelete="SET NULL") |
294
|
|
|
*/ |
295
|
|
|
protected $owner; |
296
|
|
|
|
297
|
|
|
/** |
298
|
|
|
* @var Organization |
299
|
|
|
* |
300
|
|
|
* @ORM\ManyToOne(targetEntity="Oro\Bundle\OrganizationBundle\Entity\Organization") |
301
|
|
|
* @ORM\JoinColumn(name="organization_id", referencedColumnName="id", onDelete="SET NULL") |
302
|
|
|
*/ |
303
|
|
|
protected $organization; |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* @var \DateTime |
307
|
|
|
* |
308
|
|
|
* @ORM\Column(type="datetime", name="imported_at", nullable=true) |
309
|
|
|
*/ |
310
|
|
|
protected $importedAt; |
311
|
|
|
|
312
|
|
|
/** |
313
|
|
|
* @var \DateTime |
314
|
|
|
* |
315
|
|
|
* @ORM\Column(type="datetime", name="synced_at", nullable=true) |
316
|
|
|
*/ |
317
|
|
|
protected $syncedAt; |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* @param WorkflowItem $workflowItem |
321
|
|
|
* |
322
|
|
|
* @return Cart |
323
|
|
|
*/ |
324
|
|
|
public function setWorkflowItem($workflowItem) |
325
|
|
|
{ |
326
|
|
|
$this->workflowItem = $workflowItem; |
327
|
|
|
|
328
|
|
|
return $this; |
329
|
|
|
} |
330
|
|
|
|
331
|
|
|
/** |
332
|
|
|
* @return WorkflowItem |
333
|
|
|
*/ |
334
|
|
|
public function getWorkflowItem() |
335
|
|
|
{ |
336
|
|
|
return $this->workflowItem; |
337
|
|
|
} |
338
|
|
|
|
339
|
|
|
/** |
340
|
|
|
* @param WorkflowStep $workflowStep |
341
|
|
|
* |
342
|
|
|
* @return Cart |
343
|
|
|
*/ |
344
|
|
|
public function setWorkflowStep($workflowStep) |
345
|
|
|
{ |
346
|
|
|
$this->workflowStep = $workflowStep; |
347
|
|
|
|
348
|
|
|
return $this; |
349
|
|
|
} |
350
|
|
|
|
351
|
|
|
/** |
352
|
|
|
* @return WorkflowStep |
353
|
|
|
*/ |
354
|
|
|
public function getWorkflowStep() |
355
|
|
|
{ |
356
|
|
|
return $this->workflowStep; |
357
|
|
|
} |
358
|
|
|
|
359
|
|
|
public function __construct() |
360
|
|
|
{ |
361
|
|
|
parent::__construct(); |
362
|
|
|
|
363
|
|
|
$this->status = new CartStatus('open'); |
364
|
|
|
$this->cartItems = new ArrayCollection(); |
365
|
|
|
} |
366
|
|
|
|
367
|
|
|
/** |
368
|
|
|
* @return CartItem[]|Collection |
369
|
|
|
*/ |
370
|
|
|
public function getCartItems() |
371
|
|
|
{ |
372
|
|
|
return $this->cartItems; |
373
|
|
|
} |
374
|
|
|
|
375
|
|
|
/** |
376
|
|
|
* @param CartItem[]|Collection $cartItems |
377
|
|
|
*/ |
378
|
|
|
public function setCartItems(Collection $cartItems) |
379
|
|
|
{ |
380
|
|
|
$this->cartItems = $cartItems; |
381
|
|
|
} |
382
|
|
|
|
383
|
|
|
/** |
384
|
|
|
* @param Store $store |
385
|
|
|
*/ |
386
|
|
|
public function setStore($store) |
387
|
|
|
{ |
388
|
|
|
$this->store = $store; |
389
|
|
|
} |
390
|
|
|
|
391
|
|
|
/** |
392
|
|
|
* @return Store |
393
|
|
|
*/ |
394
|
|
|
public function getStore() |
395
|
|
|
{ |
396
|
|
|
return $this->store; |
397
|
|
|
} |
398
|
|
|
|
399
|
|
|
/** |
400
|
|
|
* @return Customer |
401
|
|
|
*/ |
402
|
|
|
public function getCustomer() |
403
|
|
|
{ |
404
|
|
|
return $this->customer; |
405
|
|
|
} |
406
|
|
|
|
407
|
|
|
/** |
408
|
|
|
* @param Customer|null $customer |
409
|
|
|
* |
410
|
|
|
* @return Cart |
411
|
|
|
*/ |
412
|
|
|
public function setCustomer(Customer $customer = null) |
413
|
|
|
{ |
414
|
|
|
$this->customer = $customer; |
415
|
|
|
|
416
|
|
|
return $this; |
417
|
|
|
} |
418
|
|
|
|
419
|
|
|
/** |
420
|
|
|
* @param CartAddress $shippingAddress |
421
|
|
|
* |
422
|
|
|
* @return Cart |
423
|
|
|
*/ |
424
|
|
|
public function setShippingAddress(CartAddress $shippingAddress = null) |
425
|
|
|
{ |
426
|
|
|
$this->shippingAddress = $shippingAddress; |
427
|
|
|
|
428
|
|
|
return $this; |
429
|
|
|
} |
430
|
|
|
|
431
|
|
|
/** |
432
|
|
|
* @param CartAddress $billingAddress |
433
|
|
|
* |
434
|
|
|
* @return Cart |
435
|
|
|
*/ |
436
|
|
|
public function setBillingAddress(CartAddress $billingAddress = null) |
437
|
|
|
{ |
438
|
|
|
$this->billingAddress = $billingAddress; |
439
|
|
|
|
440
|
|
|
return $this; |
441
|
|
|
} |
442
|
|
|
|
443
|
|
|
/** |
444
|
|
|
* @return CartAddress |
445
|
|
|
*/ |
446
|
|
|
public function getBillingAddress() |
447
|
|
|
{ |
448
|
|
|
return $this->billingAddress; |
449
|
|
|
} |
450
|
|
|
|
451
|
|
|
/** |
452
|
|
|
* @return CartAddress |
453
|
|
|
*/ |
454
|
|
|
public function getShippingAddress() |
455
|
|
|
{ |
456
|
|
|
return $this->shippingAddress; |
457
|
|
|
} |
458
|
|
|
|
459
|
|
|
/** |
460
|
|
|
* @return string |
461
|
|
|
*/ |
462
|
|
|
public function getEmail() |
463
|
|
|
{ |
464
|
|
|
return $this->email; |
465
|
|
|
} |
466
|
|
|
|
467
|
|
|
/** |
468
|
|
|
* @param string $email |
469
|
|
|
* |
470
|
|
|
* @return Cart |
471
|
|
|
*/ |
472
|
|
|
public function setEmail($email) |
473
|
|
|
{ |
474
|
|
|
$this->email = $email; |
475
|
|
|
|
476
|
|
|
return $this; |
477
|
|
|
} |
478
|
|
|
|
479
|
|
|
/** |
480
|
|
|
* @return float |
481
|
|
|
*/ |
482
|
|
|
public function getItemsQty() |
483
|
|
|
{ |
484
|
|
|
return $this->itemsQty; |
485
|
|
|
} |
486
|
|
|
|
487
|
|
|
/** |
488
|
|
|
* @param float $itemsQty |
489
|
|
|
* |
490
|
|
|
* @return Cart |
491
|
|
|
*/ |
492
|
|
|
public function setItemsQty($itemsQty) |
493
|
|
|
{ |
494
|
|
|
$this->itemsQty = $itemsQty; |
495
|
|
|
|
496
|
|
|
return $this; |
497
|
|
|
} |
498
|
|
|
|
499
|
|
|
/** |
500
|
|
|
* @return float |
501
|
|
|
*/ |
502
|
|
|
public function getSubTotal() |
503
|
|
|
{ |
504
|
|
|
return $this->subTotal; |
505
|
|
|
} |
506
|
|
|
|
507
|
|
|
/** |
508
|
|
|
* @return string |
509
|
|
|
*/ |
510
|
|
|
public function getQuoteCurrencyCode() |
511
|
|
|
{ |
512
|
|
|
return $this->quoteCurrencyCode; |
513
|
|
|
} |
514
|
|
|
|
515
|
|
|
/** |
516
|
|
|
* @param string $quoteCurrencyCode |
517
|
|
|
* |
518
|
|
|
* @return Cart |
519
|
|
|
*/ |
520
|
|
|
public function setQuoteCurrencyCode($quoteCurrencyCode) |
521
|
|
|
{ |
522
|
|
|
$this->quoteCurrencyCode = $quoteCurrencyCode; |
523
|
|
|
|
524
|
|
|
return $this; |
525
|
|
|
} |
526
|
|
|
|
527
|
|
|
/** |
528
|
|
|
* @param string $paymentDetails |
529
|
|
|
*/ |
530
|
|
|
public function setPaymentDetails($paymentDetails) |
531
|
|
|
{ |
532
|
|
|
$this->paymentDetails = $paymentDetails; |
533
|
|
|
} |
534
|
|
|
|
535
|
|
|
/** |
536
|
|
|
* @return string |
537
|
|
|
*/ |
538
|
|
|
public function getPaymentDetails() |
539
|
|
|
{ |
540
|
|
|
return $this->paymentDetails; |
541
|
|
|
} |
542
|
|
|
|
543
|
|
|
/** |
544
|
|
|
* @param CartStatus $status |
545
|
|
|
* |
546
|
|
|
* @return Cart |
547
|
|
|
*/ |
548
|
|
|
public function setStatus($status) |
549
|
|
|
{ |
550
|
|
|
$this->status = $status; |
551
|
|
|
|
552
|
|
|
return $this; |
553
|
|
|
} |
554
|
|
|
|
555
|
|
|
/** |
556
|
|
|
* @return CartStatus |
557
|
|
|
*/ |
558
|
|
|
public function getStatus() |
559
|
|
|
{ |
560
|
|
|
return $this->status; |
561
|
|
|
} |
562
|
|
|
|
563
|
|
|
/** |
564
|
|
|
* @param string $baseCurrencyCode |
565
|
|
|
* |
566
|
|
|
* @return Cart |
567
|
|
|
*/ |
568
|
|
|
public function setBaseCurrencyCode($baseCurrencyCode) |
569
|
|
|
{ |
570
|
|
|
$this->baseCurrencyCode = $baseCurrencyCode; |
571
|
|
|
|
572
|
|
|
return $this; |
573
|
|
|
} |
574
|
|
|
|
575
|
|
|
/** |
576
|
|
|
* @return string |
577
|
|
|
*/ |
578
|
|
|
public function getBaseCurrencyCode() |
579
|
|
|
{ |
580
|
|
|
return $this->baseCurrencyCode; |
581
|
|
|
} |
582
|
|
|
|
583
|
|
|
/** |
584
|
|
|
* @param string $giftMessage |
585
|
|
|
* |
586
|
|
|
* @return Cart |
587
|
|
|
*/ |
588
|
|
|
public function setGiftMessage($giftMessage) |
589
|
|
|
{ |
590
|
|
|
$this->giftMessage = $giftMessage; |
591
|
|
|
|
592
|
|
|
return $this; |
593
|
|
|
} |
594
|
|
|
|
595
|
|
|
/** |
596
|
|
|
* @return string |
597
|
|
|
*/ |
598
|
|
|
public function getGiftMessage() |
599
|
|
|
{ |
600
|
|
|
return $this->giftMessage; |
601
|
|
|
} |
602
|
|
|
|
603
|
|
|
/** |
604
|
|
|
* @param float $isGuest |
605
|
|
|
* |
606
|
|
|
* @return Cart |
607
|
|
|
*/ |
608
|
|
|
public function setIsGuest($isGuest) |
609
|
|
|
{ |
610
|
|
|
$this->isGuest = $isGuest; |
611
|
|
|
|
612
|
|
|
return $this; |
613
|
|
|
} |
614
|
|
|
|
615
|
|
|
/** |
616
|
|
|
* @return float |
617
|
|
|
*/ |
618
|
|
|
public function getIsGuest() |
619
|
|
|
{ |
620
|
|
|
return $this->isGuest; |
621
|
|
|
} |
622
|
|
|
|
623
|
|
|
/** |
624
|
|
|
* @param int $itemsCount |
625
|
|
|
* |
626
|
|
|
* @return Cart |
627
|
|
|
*/ |
628
|
|
|
public function setItemsCount($itemsCount) |
629
|
|
|
{ |
630
|
|
|
$this->itemsCount = $itemsCount; |
631
|
|
|
|
632
|
|
|
return $this; |
633
|
|
|
} |
634
|
|
|
|
635
|
|
|
/** |
636
|
|
|
* @return int |
637
|
|
|
*/ |
638
|
|
|
public function getItemsCount() |
639
|
|
|
{ |
640
|
|
|
return $this->itemsCount; |
641
|
|
|
} |
642
|
|
|
|
643
|
|
|
/** |
644
|
|
|
* @param string $storeCurrencyCode |
645
|
|
|
* |
646
|
|
|
* @return Cart |
647
|
|
|
*/ |
648
|
|
|
public function setStoreCurrencyCode($storeCurrencyCode) |
649
|
|
|
{ |
650
|
|
|
$this->storeCurrencyCode = $storeCurrencyCode; |
651
|
|
|
|
652
|
|
|
return $this; |
653
|
|
|
} |
654
|
|
|
|
655
|
|
|
/** |
656
|
|
|
* @return string |
657
|
|
|
*/ |
658
|
|
|
public function getStoreCurrencyCode() |
659
|
|
|
{ |
660
|
|
|
return $this->storeCurrencyCode; |
661
|
|
|
} |
662
|
|
|
|
663
|
|
|
/** |
664
|
|
|
* @param float $storeToBaseRate |
665
|
|
|
* |
666
|
|
|
* @return Cart |
667
|
|
|
*/ |
668
|
|
|
public function setStoreToBaseRate($storeToBaseRate) |
669
|
|
|
{ |
670
|
|
|
$this->storeToBaseRate = $storeToBaseRate; |
671
|
|
|
|
672
|
|
|
return $this; |
673
|
|
|
} |
674
|
|
|
|
675
|
|
|
/** |
676
|
|
|
* @return float |
677
|
|
|
*/ |
678
|
|
|
public function getStoreToBaseRate() |
679
|
|
|
{ |
680
|
|
|
return $this->storeToBaseRate; |
681
|
|
|
} |
682
|
|
|
|
683
|
|
|
/** |
684
|
|
|
* @param float $storeToQuoteRate |
685
|
|
|
* |
686
|
|
|
* @return Cart |
687
|
|
|
*/ |
688
|
|
|
public function setStoreToQuoteRate($storeToQuoteRate) |
689
|
|
|
{ |
690
|
|
|
$this->storeToQuoteRate = $storeToQuoteRate; |
691
|
|
|
|
692
|
|
|
return $this; |
693
|
|
|
} |
694
|
|
|
|
695
|
|
|
/** |
696
|
|
|
* @return float |
697
|
|
|
*/ |
698
|
|
|
public function getStoreToQuoteRate() |
699
|
|
|
{ |
700
|
|
|
return $this->storeToQuoteRate; |
701
|
|
|
} |
702
|
|
|
|
703
|
|
|
/** |
704
|
|
|
* @param Opportunity $opportunity |
705
|
|
|
* |
706
|
|
|
* @return Cart |
707
|
|
|
*/ |
708
|
|
|
public function setOpportunity($opportunity) |
709
|
|
|
{ |
710
|
|
|
$this->opportunity = $opportunity; |
711
|
|
|
|
712
|
|
|
return $this; |
713
|
|
|
} |
714
|
|
|
|
715
|
|
|
/** |
716
|
|
|
* @return Opportunity |
717
|
|
|
*/ |
718
|
|
|
public function getOpportunity() |
719
|
|
|
{ |
720
|
|
|
return $this->opportunity; |
721
|
|
|
} |
722
|
|
|
|
723
|
|
|
/** |
724
|
|
|
* @param string $notes |
725
|
|
|
* |
726
|
|
|
* @return Cart |
727
|
|
|
*/ |
728
|
|
|
public function setNotes($notes) |
729
|
|
|
{ |
730
|
|
|
$this->notes = $notes; |
731
|
|
|
return $this; |
732
|
|
|
} |
733
|
|
|
|
734
|
|
|
/** |
735
|
|
|
* @return string |
736
|
|
|
*/ |
737
|
|
|
public function getNotes() |
738
|
|
|
{ |
739
|
|
|
return $this->notes; |
740
|
|
|
} |
741
|
|
|
|
742
|
|
|
/** |
743
|
|
|
* Pre persist event listener |
744
|
|
|
* |
745
|
|
|
* @ORM\PrePersist |
746
|
|
|
*/ |
747
|
|
|
public function beforeSave() |
748
|
|
|
{ |
749
|
|
|
$this->updateNames(); |
750
|
|
|
} |
751
|
|
|
|
752
|
|
|
/** |
753
|
|
|
* Pre update event handler |
754
|
|
|
* |
755
|
|
|
* @ORM\PreUpdate |
756
|
|
|
*/ |
757
|
|
|
public function doPreUpdate() |
758
|
|
|
{ |
759
|
|
|
$this->updateNames(); |
760
|
|
|
} |
761
|
|
|
|
762
|
|
|
/** |
763
|
|
|
* @param string $statusMessage |
764
|
|
|
*/ |
765
|
|
|
public function setStatusMessage($statusMessage) |
766
|
|
|
{ |
767
|
|
|
$this->statusMessage = $statusMessage; |
768
|
|
|
} |
769
|
|
|
|
770
|
|
|
/** |
771
|
|
|
* @return string |
772
|
|
|
*/ |
773
|
|
|
public function getStatusMessage() |
774
|
|
|
{ |
775
|
|
|
return $this->statusMessage; |
776
|
|
|
} |
777
|
|
|
|
778
|
|
|
/** |
779
|
|
|
* @return User |
780
|
|
|
*/ |
781
|
|
|
public function getOwner() |
782
|
|
|
{ |
783
|
|
|
return $this->owner; |
784
|
|
|
} |
785
|
|
|
|
786
|
|
|
/** |
787
|
|
|
* @param User $user |
788
|
|
|
*/ |
789
|
|
|
public function setOwner(User $user) |
790
|
|
|
{ |
791
|
|
|
$this->owner = $user; |
792
|
|
|
} |
793
|
|
|
|
794
|
|
|
/** |
795
|
|
|
* Set organization |
796
|
|
|
* |
797
|
|
|
* @param Organization $organization |
798
|
|
|
* @return Cart |
799
|
|
|
*/ |
800
|
|
|
public function setOrganization(Organization $organization = null) |
801
|
|
|
{ |
802
|
|
|
$this->organization = $organization; |
803
|
|
|
|
804
|
|
|
return $this; |
805
|
|
|
} |
806
|
|
|
|
807
|
|
|
/** |
808
|
|
|
* Get organization |
809
|
|
|
* |
810
|
|
|
* @return Organization |
811
|
|
|
*/ |
812
|
|
|
public function getOrganization() |
813
|
|
|
{ |
814
|
|
|
return $this->organization; |
815
|
|
|
} |
816
|
|
|
|
817
|
|
|
/** |
818
|
|
|
* @return \DateTime |
819
|
|
|
*/ |
820
|
|
|
public function getSyncedAt() |
821
|
|
|
{ |
822
|
|
|
return $this->syncedAt; |
823
|
|
|
} |
824
|
|
|
|
825
|
|
|
/** |
826
|
|
|
* @param \DateTime $syncedAt |
827
|
|
|
* @return Customer |
828
|
|
|
*/ |
829
|
|
|
public function setSyncedAt(\DateTime $syncedAt) |
830
|
|
|
{ |
831
|
|
|
$this->syncedAt = $syncedAt; |
832
|
|
|
|
833
|
|
|
return $this; |
834
|
|
|
} |
835
|
|
|
|
836
|
|
|
/** |
837
|
|
|
* @return \DateTime |
838
|
|
|
*/ |
839
|
|
|
public function getImportedAt() |
840
|
|
|
{ |
841
|
|
|
return $this->importedAt; |
842
|
|
|
} |
843
|
|
|
|
844
|
|
|
/** |
845
|
|
|
* @param \DateTime $importedAt |
846
|
|
|
* @return Customer |
847
|
|
|
*/ |
848
|
|
|
public function setImportedAt(\DateTime $importedAt) |
849
|
|
|
{ |
850
|
|
|
$this->importedAt = $importedAt; |
851
|
|
|
|
852
|
|
|
return $this; |
853
|
|
|
} |
854
|
|
|
|
855
|
|
|
/** |
856
|
|
|
* @return string |
857
|
|
|
*/ |
858
|
|
|
public function __toString() |
859
|
|
|
{ |
860
|
|
|
return (string)$this->getId(); |
861
|
|
|
} |
862
|
|
|
} |
863
|
|
|
|