<?phpnamespace App\Entity;use App\Repository\FreelancerAssistantRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=FreelancerAssistantRepository::class) * @ORM\EntityListeners({"App\Listener\FreelancerAssistantListener"}) */class FreelancerAssistant{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\OneToOne(targetEntity=User::class, inversedBy="freelancerAssistant", cascade={"persist", "remove"}) * @ORM\JoinColumn(nullable=false) */ private $user; /** * @ORM\ManyToOne(targetEntity=Freelancer::class, inversedBy="freelancerAssistants") * @ORM\JoinColumn(nullable=false) */ private $freelancer; /** * @ORM\ManyToMany(targetEntity=Store::class) */ private $stores; public function __construct() { $this->stores = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getUser(): ?User { return $this->user; } public function setUser(User $user): self { $this->user = $user; return $this; } public function getFreelancer(): ?Freelancer { return $this->freelancer; } public function setFreelancer(?Freelancer $freelancer): self { $this->freelancer = $freelancer; return $this; } /** * @return Collection|Store[] */ public function getStores(): Collection { return $this->stores; } public function addStore(Store $store): self { if (!$this->stores->contains($store)) { $this->stores[] = $store; } return $this; } public function removeStore(Store $store): self { if ($this->stores->contains($store)) { $this->stores->removeElement($store); } return $this; }}