<?php
namespace App\Entity\Otpusk;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\Otpusk\ImagesCategoryRepository")
*
* @ORM\Table(
* name="imagesCategory",
* options={
* "charset":"utf8",
* "engine": "InnoDB"
* }
* )
*/
class ImagesCategory
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="smallint", options={"unsigned"=true})
*/
private $id;
/**
* @ORM\Column(name="fName", type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Otpusk\Image", mappedBy="category", cascade={"persist"})
*/
private $images;
/**
* @ORM\Column(name="fNameUkr", type="string", length=255)
*/
private $nameUkr;
public function __construct()
{
$this->images = 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;
}
/**
* @return Collection|Image[]
*/
public function getImages(): Collection
{
return $this->images;
}
public function addImage(Image $image): self
{
if (!$this->images->contains($image)) {
$this->images[] = $image;
$image->setCategory($this);
}
return $this;
}
public function removeImage(Image $image): self
{
if ($this->images->contains($image)) {
$this->images->removeElement($image);
// set the owning side to null (unless already changed)
if ($image->getCategory() === $this) {
$image->setCategory(null);
}
}
return $this;
}
public function __toString()
{
return $this->getName();
}
public function getNameUkr(): ?string
{
return $this->nameUkr;
}
public function setNameUkr(string $nameUkr): self
{
$this->nameUkr = $nameUkr;
return $this;
}
}