-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTeamAuthorization.php
109 lines (84 loc) · 2.66 KB
/
TeamAuthorization.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?php
// This file is part of Bileto.
// Copyright 2022-2025 Probesys
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace App\Entity;
use App\ActivityMonitor\MonitorableEntityInterface;
use App\ActivityMonitor\MonitorableEntityTrait;
use App\Repository\TeamAuthorizationRepository;
use App\Uid\UidEntityInterface;
use App\Uid\UidEntityTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TeamAuthorizationRepository::class)]
class TeamAuthorization implements EntityInterface, MonitorableEntityInterface, UidEntityInterface
{
use MonitorableEntityTrait;
use UidEntityTrait;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 20, unique: true)]
private ?string $uid = null;
#[ORM\Column(type: Types::DATETIMETZ_IMMUTABLE)]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\ManyToOne]
private ?User $createdBy = null;
#[ORM\Column(type: Types::DATETIMETZ_IMMUTABLE)]
private ?\DateTimeImmutable $updatedAt = null;
#[ORM\ManyToOne]
private ?User $updatedBy = null;
#[ORM\ManyToOne(inversedBy: 'teamAuthorizations')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private ?Team $team = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private ?Role $role = null;
#[ORM\ManyToOne(inversedBy: 'teamAuthorizations')]
#[ORM\JoinColumn(onDelete: 'CASCADE')]
private ?Organization $organization = null;
/** @var Collection<int, Authorization> */
#[ORM\OneToMany(mappedBy: 'teamAuthorization', targetEntity: Authorization::class)]
private Collection $authorizations;
public function __construct()
{
$this->authorizations = new ArrayCollection();
}
public function getTeam(): ?Team
{
return $this->team;
}
public function setTeam(?Team $team): static
{
$this->team = $team;
return $this;
}
public function getRole(): ?Role
{
return $this->role;
}
public function setRole(?Role $role): static
{
$this->role = $role;
return $this;
}
public function getOrganization(): ?Organization
{
return $this->organization;
}
public function setOrganization(?Organization $organization): static
{
$this->organization = $organization;
return $this;
}
/**
* @return Collection<int, Authorization>
*/
public function getAuthorizations(): Collection
{
return $this->authorizations;
}
}