src/Entity/MenuImageCollection.php line 12
<?phpnamespace App\Entity;use App\Repository\MenuImageCollectionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: MenuImageCollectionRepository::class)]class MenuImageCollection{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(type: Types::SMALLINT)]private ?int $ordinal = null;#[ORM\Column(length: 255)]private ?string $title = null;#[ORM\Column(length: 255)]private ?string $imageFile = null;#[ORM\OneToMany(mappedBy: 'imageCollection', targetEntity: MenuImage::class)]private Collection $menuImages;public function __construct(){$this->menuImages = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getOrdinal(): ?int{return $this->ordinal;}public function setOrdinal(int $ordinal): static{$this->ordinal = $ordinal;return $this;}public function getTitle(): ?string{return $this->title;}public function setTitle(string $title): static{$this->title = $title;return $this;}public function getImageFile(): ?string{return $this->imageFile;}public function setImageFile(string $imageFile): static{$this->imageFile = $imageFile;return $this;}/*** @return Collection<int, MenuImage>*/public function getMenuImages(): Collection{return $this->menuImages;}public function addMenuImage(MenuImage $menuImage): static{if (!$this->menuImages->contains($menuImage)) {$this->menuImages->add($menuImage);$menuImage->setImageCollection($this);}return $this;}public function removeMenuImage(MenuImage $menuImage): static{if ($this->menuImages->removeElement($menuImage)) {// set the owning side to null (unless already changed)if ($menuImage->getImageCollection() === $this) {$menuImage->setImageCollection(null);}}return $this;}public function __toString(): string{return $this->getTitle(); // или getId(), или что-то другое}}