Passed
Push — main ( 23e4e5...67d574 )
by Iain
05:12
created

SubscriptionPlan::setLimits()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright Iain Cambridge 2020-2023.
7
 *
8
 * Use of this software is governed by the Business Source License included in the LICENSE file and at https://getparthenon.com/docs/next/license.
9
 *
10
 * Change Date: TBD ( 3 years after 2.2.0 release )
11
 *
12
 * On the date above, in accordance with the Business Source License, use of this software will be governed by the open source license specified in the LICENSE file.
13
 */
14
15
namespace Parthenon\Billing\Entity;
16
17
use Doctrine\Common\Collections\Collection;
18
use Parthenon\Athena\Entity\CrudEntityInterface;
19
20
class SubscriptionPlan implements CrudEntityInterface
21
{
22
    private $id;
23
24
    private bool $public = false;
25
26
    private string $name;
27
28
    private ?string $externalReference = null;
29
30
    private ?string $externalReferenceLink = null;
31
32
    private array|Collection $limits;
33
34
    /**
35
     * @return mixed
36
     */
37
    public function getId()
38
    {
39
        return $this->id;
40
    }
41
42
    /**
43
     * @param mixed $id
44
     */
45
    public function setId($id): void
46
    {
47
        $this->id = $id;
48
    }
49
50
    public function isPublic(): bool
51
    {
52
        return $this->public;
53
    }
54
55
    public function setPublic(bool $public): void
56
    {
57
        $this->public = $public;
58
    }
59
60
    public function getName(): string
61
    {
62
        return $this->name;
63
    }
64
65
    public function setName(string $name): void
66
    {
67
        $this->name = $name;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getExternalReference(): ?string
74
    {
75
        return $this->externalReference;
76
    }
77
78
    public function setExternalReference(string $externalReference): void
79
    {
80
        $this->externalReference = $externalReference;
81
    }
82
83
    public function hasExternalReference(): bool
84
    {
85
        return isset($this->externalReference);
86
    }
87
88
    public function getExternalReferenceLink(): ?string
89
    {
90
        return $this->externalReferenceLink;
91
    }
92
93
    public function setExternalReferenceLink(?string $externalReferenceLink): void
94
    {
95
        $this->externalReferenceLink = $externalReferenceLink;
96
    }
97
98
    public function getLimits(): Collection|array
99
    {
100
        return $this->limits;
101
    }
102
103
    /**
104
     * @param SubscriptionPlanLimit[]|Collection $limits
105
     */
106
    public function setLimits(Collection|array $limits): void
107
    {
108
        $this->limits = $limits;
109
    }
110
111
    public function getDisplayName(): string
112
    {
113
        return $this->name;
114
    }
115
}
116