Passed
Push — master ( d1b73c...ea55ac )
by
unknown
20:12 queued 09:20
created

ThirdParty::setDataExchangeParty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/* For licensing terms, see /license.txt */
6
7
namespace Chamilo\CoreBundle\Entity;
8
9
use ApiPlatform\Metadata\ApiResource;
10
use Doctrine\ORM\Mapping as ORM;
11
use Symfony\Component\Serializer\Attribute\Groups;
12
use Symfony\Component\Validator\Constraints as Assert;
13
14
#[ApiResource(
15
    normalizationContext: ['groups' => ['third_party:read']],
16
    denormalizationContext: ['groups' => ['third_party:write']],
17
    paginationEnabled: false,
18
    security: "is_granted('ROLE_ADMIN')"
19
)]
20
#[ORM\Table(name: 'third_party')]
21
#[ORM\Entity]
22
class ThirdParty
23
{
24
    #[Groups(['third_party:read'])]
25
    #[ORM\Id]
26
    #[ORM\GeneratedValue]
27
    #[ORM\Column(type: 'integer')]
28
    protected ?int $id = null;
29
30
    #[Groups(['third_party:read', 'third_party:write'])]
31
    #[Assert\NotBlank]
32
    #[ORM\Column(name: 'title', type: 'text')]
33
    protected string $title;
34
35
    #[Groups(['third_party:read', 'third_party:write'])]
36
    #[ORM\Column(type: 'text', nullable: true)]
37
    protected ?string $description = null;
38
39
    #[Groups(['third_party:read', 'third_party:write'])]
40
    #[ORM\Column(type: 'text', nullable: true)]
41
    protected ?string $address = null;
42
43
    #[Groups(['third_party:read', 'third_party:write'])]
44
    #[Assert\Url]
45
    #[ORM\Column(type: 'text', nullable: true)]
46
    protected ?string $website = null;
47
48
    #[Groups(['third_party:read', 'third_party:write'])]
49
    #[ORM\Column(name: 'data_exchange_party', type: 'boolean')]
50
    protected bool $dataExchangeParty = false;
51
52
    #[Groups(['third_party:read', 'third_party:write'])]
53
    #[ORM\Column(type: 'boolean')]
54
    protected bool $recruiter = false;
55
56
    public function getId(): ?int
57
    {
58
        return $this->id;
59
    }
60
61
    public function getTitle(): string
62
    {
63
        return $this->title;
64
    }
65
66
    public function setTitle(string $title): static
67
    {
68
        $this->title = $title;
69
70
        return $this;
71
    }
72
73
    public function getDescription(): ?string
74
    {
75
        return $this->description;
76
    }
77
78
    public function setDescription(?string $description): static
79
    {
80
        $this->description = $description;
81
82
        return $this;
83
    }
84
85
    public function getAddress(): ?string
86
    {
87
        return $this->address;
88
    }
89
90
    public function setAddress(?string $address): static
91
    {
92
        $this->address = $address;
93
94
        return $this;
95
    }
96
97
    public function getWebsite(): ?string
98
    {
99
        return $this->website;
100
    }
101
102
    public function setWebsite(?string $website): static
103
    {
104
        $this->website = $website;
105
106
        return $this;
107
    }
108
109
    public function isDataExchangeParty(): bool
110
    {
111
        return $this->dataExchangeParty;
112
    }
113
114
    public function setDataExchangeParty(bool $value): static
115
    {
116
        $this->dataExchangeParty = $value;
117
118
        return $this;
119
    }
120
121
    public function isRecruiter(): bool
122
    {
123
        return $this->recruiter;
124
    }
125
126
    public function setRecruiter(bool $value): static
127
    {
128
        $this->recruiter = $value;
129
130
        return $this;
131
    }
132
}
133