for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use App\Repository\OrganizationRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: OrganizationRepository::class)]
#[ApiResource]
class Organization
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $Name = null;
/**
* @var Collection<int, User>
*/
#[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'organizations')]
private Collection $User;
public function __construct()
$this->User = new ArrayCollection();
}
public function getId(): ?int
return $this->id;
public function getName(): ?string
return $this->Name;
public function setName(string $Name): static
$this->Name = $Name;
return $this;
* @return Collection<int, User>
public function getUser(): Collection
return $this->User;
public function addUser(User $user): static
if (!$this->User->contains($user)) {
$this->User->add($user);
public function removeUser(User $user): static
$this->User->removeElement($user);