| Total Complexity | 8 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | #[ORM\Entity(repositoryClass: OrganizationRepository::class)] |
||
| 12 | #[ApiResource] |
||
| 13 | class Organization |
||
| 14 | { |
||
| 15 | #[ORM\Id] |
||
| 16 | #[ORM\GeneratedValue] |
||
| 17 | #[ORM\Column] |
||
| 18 | private ?int $id = null; |
||
| 19 | |||
| 20 | #[ORM\Column(length: 255)] |
||
| 21 | private ?string $Name = null; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var Collection<int, User> |
||
| 25 | */ |
||
| 26 | #[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'organizations')] |
||
| 27 | private Collection $User; |
||
| 28 | |||
| 29 | public function __construct() |
||
| 30 | { |
||
| 31 | $this->User = new ArrayCollection(); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getId(): ?int |
||
| 35 | { |
||
| 36 | return $this->id; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getName(): ?string |
||
| 40 | { |
||
| 41 | return $this->Name; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function setName(string $Name): static |
||
| 45 | { |
||
| 46 | $this->Name = $Name; |
||
| 47 | |||
| 48 | return $this; |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @return Collection<int, User> |
||
| 53 | */ |
||
| 54 | public function getUser(): Collection |
||
| 55 | { |
||
| 56 | return $this->User; |
||
| 57 | } |
||
| 58 | |||
| 59 | public function addUser(User $user): static |
||
| 66 | } |
||
| 67 | |||
| 68 | public function removeUser(User $user): static |
||
| 73 | } |
||
| 74 | } |
||
| 75 |