GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Article::getConfiguratorSetId()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Neta\Shopware\SDK\Entity.
4
 *
5
 * Copyright 2016 LeadCommerce
6
 *
7
 * @author    Alexander Mahrt <[email protected]>
8
 * @copyright 2016 LeadCommerce <[email protected]>
9
 */
10
11
namespace Neta\Shopware\SDK\Entity;
12
13
use RuntimeException;
14
15
/**
16
 * Class Article.
17
 */
18
class Article extends Base
19
{
20
    /**
21
     * @var int
22
     */
23
    protected $id;
24
    /**
25
     * @var int
26
     */
27
    protected $mainDetailId;
28
    /**
29
     * @var int
30
     */
31
    protected $supplierId;
32
    /**
33
     * @var string
34
     */
35
    protected $supplier;
36
    /**
37
     * @var int
38
     */
39
    protected $taxId;
40
    /**
41
     * @var float
42
     */
43
    protected $tax;
44
    /**
45
     * @var int
46
     */
47
    protected $priceGroupId;
48
    /**
49
     * @var int
50
     */
51
    protected $filterGroupId;
52
    /**
53
     * @var int
54
     */
55
    protected $configuratorSetId;
56
    /**
57
     * @var string
58
     */
59
    protected $name;
60
    /**
61
     * @var string
62
     */
63
    protected $description;
64
    /**
65
     * @var string
66
     */
67
    protected $descriptionLong;
68
    /**
69
     * @var string
70
     */
71
    protected $added;
72
    /**
73
     * @var bool
74
     */
75
    protected $active;
76
    /**
77
     * @var int
78
     */
79
    protected $pseudoSales;
80
    /**
81
     * @var bool
82
     */
83
    protected $highlight;
84
    /**
85
     * @var string
86
     */
87
    protected $keywords;
88
    /**
89
     * @var string
90
     */
91
    protected $metaTitle;
92
    /**
93
     * @var string
94
     */
95
    protected $changed;
96
    /**
97
     * @var bool
98
     */
99
    protected $priceGroupActive;
100
    /**
101
     * @var bool
102
     */
103
    protected $lastStock;
104
    /**
105
     * @var bool
106
     */
107
    protected $crossBundleLook;
108
    /**
109
     * @var bool
110
     */
111
    protected $notification;
112
    /**
113
     * @var string
114
     */
115
    protected $template;
116
    /**
117
     * @var int
118
     */
119
    protected $mode;
120
    /**
121
     * @var string
122
     */
123
    protected $availableFrom;
124
    /**
125
     * @var string
126
     */
127
    protected $availableTo;
128
    /**
129
     * @var ArticleAttribute
130
     */
131
    protected $attribute;
132
    /**
133
     * @var Category[]
134
     */
135
    protected $categories;
136
    /**
137
     * @var ArticleDetail
138
     */
139
    protected $mainDetail;
140
141
    /**
142
     * @return int
143
     */
144 5
    public function getId()
145
    {
146 5
        return $this->id;
147
    }
148
149
    /**
150
     * @param int $id
151
     *
152
     * @return Article
153
     */
154 13
    public function setId($id)
155
    {
156 13
        $this->id = $id;
157
158 13
        return $this;
159
    }
160
161
    /**
162
     * @return int
163
     */
164 3
    public function getMainDetailId()
165
    {
166 3
        return $this->mainDetailId;
167
    }
168
169
    /**
170
     * @param int $mainDetailId
171
     *
172
     * @return Article
173
     */
174 12
    public function setMainDetailId($mainDetailId)
175
    {
176 12
        $this->mainDetailId = $mainDetailId;
177
178 12
        return $this;
179
    }
180
181
    /**
182
     * @return int
183
     */
184
    public function getSupplierId()
185
    {
186
        return $this->supplierId;
187
    }
188
189
    /**
190
     * @param int $supplierId
191
     *
192
     * @return Article
193
     */
194 11
    public function setSupplierId($supplierId)
195
    {
196 11
        $this->supplierId = $supplierId;
197
198 11
        return $this;
199
    }
200
201
    /**
202
     * @return string
203
     */
204
    public function getSupplier()
205
    {
206
        return $this->supplier;
207
    }
208
209
    /**
210
     * @param string $supplier
211
     */
212
    public function setSupplier($supplier)
213
    {
214
        $this->supplier = $supplier;
215
    }
216
217
    /**
218
     * @return int
219
     */
220
    public function getTaxId()
221
    {
222
        return $this->taxId;
223
    }
224
225
    /**
226
     * @param int $taxId
227
     *
228
     * @return Article
229
     */
230 13
    public function setTaxId($taxId)
231
    {
232 13
        $this->taxId = $taxId;
233
234 13
        return $this;
235
    }
236
237
    /**
238
     * @return float
239
     */
240
    public function getTax()
241
    {
242
        return $this->tax;
243
    }
244
245
    /**
246
     * @param float $tax
247
     */
248
    public function setTax($tax)
249
    {
250
        $this->tax = $tax;
251
    }
252
253
    /**
254
     * @return int
255
     */
256
    public function getPriceGroupId()
257
    {
258
        return $this->priceGroupId;
259
    }
260
261
    /**
262
     * @param int $priceGroupId
263
     *
264
     * @return Article
265
     */
266 11
    public function setPriceGroupId($priceGroupId)
267
    {
268 11
        $this->priceGroupId = $priceGroupId;
269
270 11
        return $this;
271
    }
272
273
    /**
274
     * @return int
275
     */
276
    public function getFilterGroupId()
277
    {
278
        return $this->filterGroupId;
279
    }
280
281
    /**
282
     * @param int $filterGroupId
283
     *
284
     * @return Article
285
     */
286 11
    public function setFilterGroupId($filterGroupId)
287
    {
288 11
        $this->filterGroupId = $filterGroupId;
289
290 11
        return $this;
291
    }
292
293
    /**
294
     * @return int
295
     */
296
    public function getConfiguratorSetId()
297
    {
298
        return $this->configuratorSetId;
299
    }
300
301
    /**
302
     * @param int $configuratorSetId
303
     *
304
     * @return Article
305
     */
306 11
    public function setConfiguratorSetId($configuratorSetId)
307
    {
308 11
        $this->configuratorSetId = $configuratorSetId;
309
310 11
        return $this;
311
    }
312
313
    /**
314
     * @return string
315
     */
316 5
    public function getName()
317
    {
318 5
        return $this->name;
319
    }
320
321
    /**
322
     * @param string $name
323
     *
324
     * @return Article
325
     */
326 12
    public function setName($name)
327
    {
328 12
        $this->name = $name;
329
330 12
        return $this;
331
    }
332
333
    /**
334
     * @return string
335
     */
336
    public function getDescription()
337
    {
338
        return $this->description;
339
    }
340
341
    /**
342
     * @param string $description
343
     *
344
     * @return Article
345
     */
346 11
    public function setDescription($description)
347
    {
348 11
        $this->description = $description;
349
350 11
        return $this;
351
    }
352
353
    /**
354
     * @return string
355
     */
356
    public function getDescriptionLong()
357
    {
358
        return $this->descriptionLong;
359
    }
360
361
    /**
362
     * @param string $descriptionLong
363
     *
364
     * @return Article
365
     */
366 11
    public function setDescriptionLong($descriptionLong)
367
    {
368 11
        $this->descriptionLong = $descriptionLong;
369
370 11
        return $this;
371
    }
372
373
    /**
374
     * @return string
375
     */
376
    public function getAdded()
377
    {
378
        return $this->added;
379
    }
380
381
    /**
382
     * @param string $added
383
     *
384
     * @return Article
385
     */
386 11
    public function setAdded($added)
387
    {
388 11
        $this->added = $added;
389
390 11
        return $this;
391
    }
392
393
    /**
394
     * @return bool
395
     */
396 2
    public function isActive()
397
    {
398 2
        return $this->active;
399
    }
400
401
    /**
402
     * @param bool $active
403
     *
404
     * @return Article
405
     */
406 11
    public function setActive($active)
407
    {
408 11
        $this->active = $active;
409
410 11
        return $this;
411
    }
412
413
    /**
414
     * @return int
415
     */
416
    public function getPseudoSales()
417
    {
418
        return $this->pseudoSales;
419
    }
420
421
    /**
422
     * @param int $pseudoSales
423
     *
424
     * @return Article
425
     */
426 11
    public function setPseudoSales($pseudoSales)
427
    {
428 11
        $this->pseudoSales = $pseudoSales;
429
430 11
        return $this;
431
    }
432
433
    /**
434
     * @return bool
435
     */
436
    public function isHighlight()
437
    {
438
        return $this->highlight;
439
    }
440
441
    /**
442
     * @param bool $highlight
443
     *
444
     * @return Article
445
     */
446 11
    public function setHighlight($highlight)
447
    {
448 11
        $this->highlight = $highlight;
449
450 11
        return $this;
451
    }
452
453
    /**
454
     * @return string
455
     */
456
    public function getKeywords()
457
    {
458
        return $this->keywords;
459
    }
460
461
    /**
462
     * @param string $keywords
463
     *
464
     * @return Article
465
     */
466 11
    public function setKeywords($keywords)
467
    {
468 11
        $this->keywords = $keywords;
469
470 11
        return $this;
471
    }
472
473
    /**
474
     * @return string
475
     */
476
    public function getMetaTitle()
477
    {
478
        return $this->metaTitle;
479
    }
480
481
    /**
482
     * @param string $metaTitle
483
     *
484
     * @return Article
485
     */
486 11
    public function setMetaTitle($metaTitle)
487
    {
488 11
        $this->metaTitle = $metaTitle;
489
490 11
        return $this;
491
    }
492
493
    /**
494
     * @return string
495
     */
496
    public function getChanged()
497
    {
498
        return $this->changed;
499
    }
500
501
    /**
502
     * @param string $changed
503
     *
504
     * @return Article
505
     */
506
    public function setChanged($changed)
507
    {
508
        $this->changed = $changed;
509
510
        return $this;
511
    }
512
513
    /**
514
     * @return bool
515
     */
516
    public function isPriceGroupActive()
517
    {
518
        return $this->priceGroupActive;
519
    }
520
521
    /**
522
     * @param bool $priceGroupActive
523
     *
524
     * @return Article
525
     */
526 11
    public function setPriceGroupActive($priceGroupActive)
527
    {
528 11
        $this->priceGroupActive = $priceGroupActive;
529
530 11
        return $this;
531
    }
532
533
    /**
534
     * @return bool
535
     */
536
    public function isLastStock()
537
    {
538
        return $this->lastStock;
539
    }
540
541
    /**
542
     * @param bool $lastStock
543
     *
544
     * @return Article
545
     */
546 11
    public function setLastStock($lastStock)
547
    {
548 11
        $this->lastStock = $lastStock;
549
550 11
        return $this;
551
    }
552
553
    /**
554
     * @return bool
555
     */
556
    public function isCrossBundleLook()
557
    {
558
        return $this->crossBundleLook;
559
    }
560
561
    /**
562
     * @param bool $crossBundleLook
563
     *
564
     * @return Article
565
     */
566 11
    public function setCrossBundleLook($crossBundleLook)
567
    {
568 11
        $this->crossBundleLook = $crossBundleLook;
569
570 11
        return $this;
571
    }
572
573
    /**
574
     * @return bool
575
     */
576
    public function isNotification()
577
    {
578
        return $this->notification;
579
    }
580
581
    /**
582
     * @param bool $notification
583
     *
584
     * @return Article
585
     */
586 11
    public function setNotification($notification)
587
    {
588 11
        $this->notification = $notification;
589
590 11
        return $this;
591
    }
592
593
    /**
594
     * @return string
595
     */
596
    public function getTemplate()
597
    {
598
        return $this->template;
599
    }
600
601
    /**
602
     * @param string $template
603
     *
604
     * @return Article
605
     */
606 11
    public function setTemplate($template)
607
    {
608 11
        $this->template = $template;
609
610 11
        return $this;
611
    }
612
613
    /**
614
     * @return int
615
     */
616
    public function getMode()
617
    {
618
        return $this->mode;
619
    }
620
621
    /**
622
     * @param int $mode
623
     *
624
     * @return Article
625
     */
626 11
    public function setMode($mode)
627
    {
628 11
        $this->mode = $mode;
629
630 11
        return $this;
631
    }
632
633
    /**
634
     * @return string
635
     */
636
    public function getAvailableFrom()
637
    {
638
        return $this->availableFrom;
639
    }
640
641
    /**
642
     * @param string $availableFrom
643
     *
644
     * @return Article
645
     */
646 11
    public function setAvailableFrom($availableFrom)
647
    {
648 11
        $this->availableFrom = $availableFrom;
649
650 11
        return $this;
651
    }
652
653
    /**
654
     * @return string
655
     */
656
    public function getAvailableTo()
657
    {
658
        return $this->availableTo;
659
    }
660
661
    /**
662
     * @param string $availableTo
663
     *
664
     * @return Article
665
     */
666 11
    public function setAvailableTo($availableTo)
667
    {
668 11
        $this->availableTo = $availableTo;
669
670 11
        return $this;
671
    }
672
673
    /**
674
     * @return \Neta\Shopware\SDK\Entity\ArticleAttribute
675
     */
676 1
    public function getAttribute(): ?ArticleAttribute
677
    {
678 1
        return $this->attribute;
679
    }
680
681
    /**
682
     * @param \Neta\Shopware\SDK\Entity\ArticleAttribute|array $value
683
     *
684
     * @return \Neta\Shopware\SDK\Entity\Article
685
     */
686 11
    public function setAttribute($value)
687
    {
688 11
        if (is_array($value)) {
689 11
            $value = (new ArticleAttribute)->setEntityAttributes($value);
690
        }
691
692 11
        if ($value instanceof ArticleAttribute) {
693 11
            $this->attribute = $value;
694
695 11
            return $this;
696
        }
697
698
        throw new RuntimeException('Invalid value provided for `attribute`');
699
    }
700
701
    /**
702
     * @return mixed
703
     */
704
    public function getCategories()
705
    {
706
        return $this->categories;
707
    }
708
709
    /**
710
     * @param Category[] $categories
711
     *
712
     * @return Article
713
     */
714
    public function setCategories($categories)
715
    {
716
        $this->categories = $categories;
717
718
        return $this;
719
    }
720
721
    /**
722
     * @return \Neta\Shopware\SDK\Entity\ArticleDetail
723
     */
724 2
    public function getMainDetail(): ?ArticleDetail
725
    {
726 2
        return $this->mainDetail;
727
    }
728
729
    /**
730
     * @param \Neta\Shopware\SDK\Entity\ArticleDetail|array $value
731
     * @return \Neta\Shopware\SDK\Entity\Article
732
     */
733 3
    public function setMainDetail($value)
734
    {
735 3
        if (is_array($value)) {
736 3
            $value = (new ArticleDetail)->setEntityAttributes($value);
737
        }
738
739 3
        if ($value instanceof ArticleDetail) {
740 3
            $this->mainDetail = $value;
741
742 3
            return $this;
743
        }
744
745
        throw new RuntimeException('Invalid value provided for `mainDetail`');
746
    }
747
748
    /**
749
     * @return array
750
     */
751 4
    public function getArrayCopy()
752
    {
753 4
        $arrayCopy = parent::getArrayCopy();
754 4
        if (! empty($arrayCopy['taxId'])) {
755 1
            $arrayCopy['tax'] = $arrayCopy['taxId'];
756 1
            unset($arrayCopy['taxId']);
757
        }
758
759 4
        return $arrayCopy;
760
    }
761
}
762