<?phpnamespace App\Entity;use App\Repository\MymarketRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=MymarketRepository::class) */class Mymarket{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="text", nullable=true) */ private $description; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $image; /** * @ORM\OneToMany(targetEntity=Categories::class, mappedBy="mymarket") */ private $categories; public function __construct() { $this->categories = 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 getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getImage(): ?string { return $this->image; } public function setImage(?string $image): self { $this->image = $image; return $this; } /** * @return Collection|Categories[] */ public function getCategories(): Collection { return $this->categories; } public function addCategory(Categories $category): self { if (!$this->categories->contains($category)) { $this->categories[] = $category; $category->setMymarket($this); } return $this; } public function removeCategory(Categories $category): self { if ($this->categories->removeElement($category)) { // set the owning side to null (unless already changed) if ($category->getMymarket() === $this) { $category->setMymarket(null); } } return $this; } public function __toString() { return $this->name; }}