Completed
Pull Request — master (#422)
by Jonas
05:22
created

Attribute::getUpdateLongDescription()   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
 * (c) shopware AG <[email protected]>
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Shopware\CustomModels\Connect;
9
10
use Doctrine\ORM\Mapping as ORM;
11
use Shopware\Components\Model\ModelEntity;
12
13
/**
14
 * Connect specific attributes for shopware Connect products
15
 *
16
 * @ORM\Table(name="s_plugin_connect_items")
17
 * @ORM\Entity(repositoryClass="AttributeRepository")
18
 */
19
class Attribute extends ModelEntity
20
{
21
    const STATUS_INSERT = 'insert';
22
    const STATUS_UPDATE = 'update';
23
    const STATUS_SYNCED = 'synced';
24
    const STATUS_ERROR = 'error';
25
    const STATUS_ERROR_PRICE = 'error-price';
26
    const STATUS_DELETE = 'delete';
27
    const STATUS_INACTIVE = 'inactive';
28
29
    /**
30
     * @var int
31
     * @ORM\Id
32
     * @ORM\GeneratedValue(strategy="IDENTITY")
33
     * @ORM\Column(name="id", type="integer", nullable=false)
34
     */
35
     protected $id;
36
37
38
    /**
39
     * @var int
40
     *
41
     * @ORM\Column(name="article_id", type="integer", nullable=true)
42
     */
43
     protected $articleId;
44
45
46
    /**
47
     * @var int
48
     *
49
     * @ORM\Column(name="article_detail_id", type="integer", nullable=true)
50
     */
51
     protected $articleDetailId;
52
53
54
    /**
55
     * @var string
56
     *
57
     * @ORM\Column(name="shop_id", type="string", nullable=true)
58
     */
59
     protected $shopId;
60
61
62
    /**
63
     * @var string
64
     *
65
     * @ORM\Column(name="source_id", type="string", nullable=true)
66
     */
67
     protected $sourceId;
68
69
70
    /**
71
     * @var string
72
     *
73
     * @ORM\Column(name="export_status", type="text", nullable=true)
74
     */
75
     protected $exportStatus;
76
77
78
    /**
79
     * @var string
80
     *
81
     * @ORM\Column(name="export_message", type="text", nullable=true)
82
     */
83
     protected $exportMessage;
84
85
    /**
86
     * @var bool
87
     *
88
     * @ORM\Column(name="exported", type="boolean", nullable=true)
89
     */
90
    protected $exported;
91
92
93
    /**
94
     * @var string
95
     *
96
     * @ORM\Column(name="category", type="text", nullable=true)
97
     */
98
     protected $category;
99
100
101
    /**
102
     * @var float
103
     *
104
     * @ORM\Column(name="purchase_price", type="float", nullable=true)
105
     */
106
     protected $purchasePrice;
107
108
109
    /**
110
     * @var int
111
     *
112
     * @ORM\Column(name="fixed_price", type="integer", nullable=true)
113
     */
114
     protected $fixedPrice;
115
116
117
    /**
118
     * @var string
119
     *
120
     * @ORM\Column(name="update_price", type="string", nullable=true)
121
     */
122
     protected $updatePrice;
123
124
125
    /**
126
     * @var string
127
     *
128
     * @ORM\Column(name="update_image", type="string", nullable=true)
129
     */
130
     protected $updateImage;
131
132
133
    /**
134
     * @var string
135
     *
136
     * @ORM\Column(name="update_long_description", type="string", nullable=true)
137
     */
138
     protected $updateLongDescription;
139
140
141
    /**
142
     * @var string
143
     *
144
     * @ORM\Column(name="update_short_description", type="string", nullable=true)
145
     */
146
     protected $updateShortDescription;
147
148
149
    /**
150
     * @var string
151
     *
152
     * @ORM\Column(name="update_additional_description", type="string", nullable=true)
153
     */
154
     protected $updateAdditionalDescription;
155
156
    /**
157
     * @var string
158
     *
159
     * @ORM\Column(name="update_name", type="string", nullable=true)
160
     */
161
     protected $updateName;
162
163
    /**
164
     * @var string
165
     *
166
     * @ORM\Column(name="update_main_image", type="string", nullable=true)
167
     */
168
    protected $updateMainImage;
169
170
171
    /**
172
     * @var string
173
     *
174
     * @ORM\Column(name="last_update", type="text", nullable=true)
175
     */
176
     protected $lastUpdate;
177
178
179
    /**
180
     * @var int
181
     *
182
     * @ORM\Column(name="last_update_flag", type="integer", nullable=true)
183
     */
184
     protected $lastUpdateFlag;
185
186
187
    /**
188
     * @var \Shopware\Models\Article\Article
189
     *
190
     * @ORM\OneToOne(targetEntity="Shopware\Models\Article\Article")
191
     * @ORM\JoinColumns({
192
     *   @ORM\JoinColumn(name="article_id", referencedColumnName="id")
193
     * })
194
     */
195
    protected $article;
196
197
198
    /**
199
     * @var \Shopware\Models\Article\Detail
200
     *
201
     * @ORM\OneToOne(targetEntity="Shopware\Models\Article\Detail")
202
     * @ORM\JoinColumns({
203
     *   @ORM\JoinColumn(name="article_detail_id", referencedColumnName="id")
204
     * })
205
     */
206
    protected $articleDetail;
207
208
    /**
209
    * @var int
210
    * @ORM\Column(name="group_id", type="integer", nullable=true)
211
    */
212
    protected $groupId;
213
214
    /**
215
    * @var bool
216
    * @ORM\Column(name="is_main_variant", type="boolean", nullable=true)
217
    */
218
    protected $isMainVariant;
219
220
    /**
221
     * @var string
222
     *
223
     * @ORM\Column(name="purchase_price_hash", type="string", nullable=false)
224
     */
225
    protected $purchasePriceHash;
226
227
    /**
228
     * @var int
229
     * @ORM\Column(name="offer_valid_until", type="integer", nullable=false)
230
     */
231
    protected $offerValidUntil;
232
233
    /**
234
     * @var string
235
     * @ORM\Column(name="stream", type="string", nullable=false)
236
     */
237
    protected $stream;
238
239
    /**
240
     * @var bool
241
     * @ORM\Column(name="cron_update", type="boolean", nullable=true)
242
     */
243
    protected $cronUpdate;
244
245
    /**
246
     * Used to store change revision for fromShop products
247
     *
248
     * @var string
249
     * @ORM\Column(name="revision", type="decimal", precision=20, scale=10, nullable=true)
250
     */
251
    protected $revision;
252
253
    /**
254
     * @param \Shopware\Models\Article\Article $article
255
     */
256
    public function setArticle($article)
257
    {
258
        $this->article = $article;
259
    }
260
261
    /**
262
     * @return \Shopware\Models\Article\Article
263
     */
264
    public function getArticle()
265
    {
266
        return $this->article;
267
    }
268
269
    /**
270
     * @param \Shopware\Models\Article\Detail $articleDetail
271
     */
272
    public function setArticleDetail($articleDetail)
273
    {
274
        $this->articleDetail = $articleDetail;
275
    }
276
277
    /**
278
     * @return \Shopware\Models\Article\Detail
279
     */
280
    public function getArticleDetail()
281
    {
282
        return $this->articleDetail;
283
    }
284
285
    /**
286
     * @return int
287
     */
288
    public function getArticleDetailId()
289
    {
290
        return $this->articleDetailId;
291
    }
292
293
    /**
294
     * @return int
295
     */
296
    public function getArticleId()
297
    {
298
        return $this->articleId;
299
    }
300
301
    /**
302
     * @param array $categories
303
     */
304
    public function setCategory($categories)
305
    {
306
        if (is_string($categories)) {
307
            $categories = [$categories];
308
        }
309
        $this->category = json_encode($categories);
310
    }
311
312
    /**
313
     * @return array
314
     */
315
    public function getCategory()
316
    {
317
        return json_decode($this->category, true) ?: [];
318
    }
319
320
    /**
321
     * @param string $exportMessage
322
     */
323
    public function setExportMessage($exportMessage)
324
    {
325
        $this->exportMessage = $exportMessage;
326
    }
327
328
    /**
329
     * @return string
330
     */
331
    public function getExportMessage()
332
    {
333
        return $this->exportMessage;
334
    }
335
336
    /**
337
     * @param string $exportStatus
338
     */
339
    public function setExportStatus($exportStatus)
340
    {
341
        $this->exportStatus = $exportStatus;
342
    }
343
344
    /**
345
     * @return string
346
     */
347
    public function getExportStatus()
348
    {
349
        return $this->exportStatus;
350
    }
351
352
    /**
353
     * @return bool
354
     */
355
    public function isExported()
356
    {
357
        return $this->exported;
358
    }
359
360
    /**
361
     * @param bool $exported
362
     */
363
    public function setExported($exported)
364
    {
365
        $this->exported = $exported;
366
    }
367
368
    /**
369
     * @param int $fixedPrice
370
     */
371
    public function setFixedPrice($fixedPrice)
372
    {
373
        $this->fixedPrice = $fixedPrice;
374
    }
375
376
    /**
377
     * @return int
378
     */
379
    public function getFixedPrice()
380
    {
381
        return $this->fixedPrice;
382
    }
383
384
    /**
385
     * @return int
386
     */
387
    public function getId()
388
    {
389
        return $this->id;
390
    }
391
392
    /**
393
     * @param string $lastUpdate
394
     */
395
    public function setLastUpdate($lastUpdate)
396
    {
397
        $this->lastUpdate = $lastUpdate;
398
    }
399
400
    /**
401
     * @return string
402
     */
403
    public function getLastUpdate()
404
    {
405
        return $this->lastUpdate;
406
    }
407
408
    /**
409
     * @param int $lastUpdateFlag
410
     */
411
    public function setLastUpdateFlag($lastUpdateFlag)
412
    {
413
        $this->lastUpdateFlag = $lastUpdateFlag;
414
    }
415
416
    /**
417
     * Helper to inverse a given flag
418
     *
419
     * @param $flagToFlip
420
     */
421
    public function flipLastUpdateFlag($flagToFlip)
422
    {
423
        $this->lastUpdateFlag = $this->lastUpdateFlag ^ $flagToFlip;
424
    }
425
426
    /**
427
     * @return int
428
     */
429
    public function getLastUpdateFlag()
430
    {
431
        return $this->lastUpdateFlag;
432
    }
433
434
    /**
435
     * @param float $purchasePrice
436
     */
437
    public function setPurchasePrice($purchasePrice)
438
    {
439
        $this->purchasePrice = $purchasePrice;
440
    }
441
442
    /**
443
     * @return float
444
     */
445
    public function getPurchasePrice()
446
    {
447
        return $this->purchasePrice;
448
    }
449
450
    /**
451
     * @param string $shopId
452
     */
453
    public function setShopId($shopId)
454
    {
455
        $this->shopId = $shopId;
456
    }
457
458
    /**
459
     * @return string
460
     */
461
    public function getShopId()
462
    {
463
        return $this->shopId;
464
    }
465
466
    /**
467
     * @param string $sourceId
468
     */
469
    public function setSourceId($sourceId)
470
    {
471
        $this->sourceId = $sourceId;
472
    }
473
474
    /**
475
     * @return string
476
     */
477
    public function getSourceId()
478
    {
479
        return $this->sourceId;
480
    }
481
482
    /**
483
     * @param string $updateImage
484
     */
485
    public function setUpdateImage($updateImage)
486
    {
487
        $this->updateImage = $updateImage;
488
    }
489
490
    /**
491
     * @return string
492
     */
493
    public function getUpdateImage()
494
    {
495
        return $this->updateImage;
496
    }
497
498
    /**
499
     * @param string $updateLongDescription
500
     */
501
    public function setUpdateLongDescription($updateLongDescription)
502
    {
503
        $this->updateLongDescription = $updateLongDescription;
504
    }
505
506
    /**
507
     * @return string
508
     */
509
    public function getUpdateLongDescription()
510
    {
511
        return $this->updateLongDescription;
512
    }
513
514
    /**
515
     * @return string
516
     */
517
    public function getUpdateAdditionalDescription()
518
    {
519
        return $this->updateAdditionalDescription;
520
    }
521
522
    /**
523
     * @param string $updateAdditionalDescription
524
     */
525
    public function setUpdateAdditionalDescription($updateAdditionalDescription)
526
    {
527
        $this->updateAdditionalDescription = $updateAdditionalDescription;
528
    }
529
530
    /**
531
     * @param string $updateName
532
     */
533
    public function setUpdateName($updateName)
534
    {
535
        $this->updateName = $updateName;
536
    }
537
538
    /**
539
     * @return string
540
     */
541
    public function getUpdateName()
542
    {
543
        return $this->updateName;
544
    }
545
546
    /**
547
     * @param string $updatePrice
548
     */
549
    public function setUpdatePrice($updatePrice)
550
    {
551
        $this->updatePrice = $updatePrice;
552
    }
553
554
    /**
555
     * @return string
556
     */
557
    public function getUpdatePrice()
558
    {
559
        return $this->updatePrice;
560
    }
561
562
    /**
563
     * @param string $updateShortDescription
564
     */
565
    public function setUpdateShortDescription($updateShortDescription)
566
    {
567
        $this->updateShortDescription = $updateShortDescription;
568
    }
569
570
    /**
571
     * @return string
572
     */
573
    public function getUpdateShortDescription()
574
    {
575
        return $this->updateShortDescription;
576
    }
577
578
    /**
579
     * @param string $updateMainImage
580
     */
581
    public function setUpdateMainImage($updateMainImage)
582
    {
583
        $this->updateMainImage = $updateMainImage;
584
    }
585
586
    /**
587
     * @return string
588
     */
589
    public function getUpdateMainImage()
590
    {
591
        return $this->updateMainImage;
592
    }
593
594
    /**
595
     * @return mixed
596
     */
597
    public function getGroupId()
598
    {
599
        return $this->groupId;
600
    }
601
602
    /**
603
     * @param mixed $groupId
604
     */
605
    public function setGroupId($groupId)
606
    {
607
        $this->groupId = $groupId;
608
    }
609
610
    /**
611
     * @return bool
612
     */
613
    public function isIsMainVariant()
614
    {
615
        return $this->isMainVariant;
616
    }
617
618
    /**
619
     * @param bool $isMainVariant
620
     */
621
    public function setIsMainVariant($isMainVariant)
622
    {
623
        $this->isMainVariant = $isMainVariant;
624
    }
625
626
    /**
627
     * @return int
628
     */
629
    public function getOfferValidUntil()
630
    {
631
        return $this->offerValidUntil;
632
    }
633
634
    /**
635
     * @param int $offerValidUntil
636
     */
637
    public function setOfferValidUntil($offerValidUntil)
638
    {
639
        $this->offerValidUntil = $offerValidUntil;
640
    }
641
642
    /**
643
     * @return string
644
     */
645
    public function getPurchasePriceHash()
646
    {
647
        return $this->purchasePriceHash;
648
    }
649
650
    /**
651
     * @param string $purchasePriceHash
652
     */
653
    public function setPurchasePriceHash($purchasePriceHash)
654
    {
655
        $this->purchasePriceHash = $purchasePriceHash;
656
    }
657
658
    /**
659
     * @return string
660
     */
661
    public function getStream()
662
    {
663
        return $this->stream;
664
    }
665
666
    /**
667
     * @param string $stream
668
     */
669
    public function setStream($stream)
670
    {
671
        $this->stream = $stream;
672
    }
673
674
    /**
675
     * @return bool
676
     */
677
    public function isCronUpdate()
678
    {
679
        return $this->cronUpdate;
680
    }
681
682
    /**
683
     * @param bool $cronUpdate
684
     */
685
    public function setCronUpdate($cronUpdate)
686
    {
687
        $this->cronUpdate = $cronUpdate;
688
    }
689
690
    /**
691
     * @return string
692
     */
693
    public function getRevision()
694
    {
695
        return $this->revision;
696
    }
697
698
    /**
699
     * @param string $revision
700
     */
701
    public function setRevision($revision)
702
    {
703
        $this->revision = $revision;
704
    }
705
}
706