[ 'normalization_context' => [ 'groups' => ['read'] ] ] ], itemOperations: ['get'], attributes:[ 'pagination_enabled' => false ] )] #[ORM\Entity(repositoryClass: TypeOfPracticeRepository::class)] class TypeOfPractice { #[ORM\Id] #[ORM\Column] #[ORM\GeneratedValue] #[Groups(["read"])] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] #[Assert\Choice(callback: ['\App\Enum\Cotisation\TypeOfPracticeEnum', 'toArray'], message: 'invalid-name')] #[Groups(["read"])] private ?string $name = null; #[ORM\Column(length: 255, nullable: true)] #[Assert\Choice(callback: ['\App\Enum\Cotisation\CategoryTypeOfPracticeEnum', 'toArray'], message: 'invalid-category')] #[Groups(["read"])] private ?string $category = null; #[ORM\ManyToMany(targetEntity: Organization::class, inversedBy: 'typeOfPractices')] #[ORM\JoinTable(name: 'organization_type_of_practices')] #[ORM\JoinColumn(name: 'typeofpractice_id', referencedColumnName: 'id')] #[ORM\InverseJoinColumn(name: 'organization_id', referencedColumnName: 'id')] private Collection $organizations; #[Pure] public function __construct() { $this->organizations = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getCategory(): ?string { return $this->category; } public function setCategory(?string $category): self { $this->category = $category; return $this; } public function getOrganizations(): Collection { return $this->organizations; } public function addOrganization(Organization $organization): self { if (!$this->organizations->contains($organization)) { $this->organizations[] = $organization; $organization->addTypeOfPractice($this); } return $this; } public function removeOrganization(Organization $organization): self { if ($this->organizations->removeElement($organization)) { $organization->removeTypeOfPractice($this); } return $this; } }