<?php
namespace App\Entity\Image;
use App\Repository\Image\ImgTypeRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* ImgType
*/
#[ORM\Table(name: 'img_type')]
#[ORM\Entity(repositoryClass: ImgTypeRepository::class)]
class ImgType implements \Stringable
{
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id = null;
#[ORM\Column(name: 'name', type: 'string', length: 255)]
private ?string $name = null;
#[ORM\OneToMany(targetEntity: Image::class, mappedBy: 'type')]
protected $images;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set name.
*
* @param string $name
*
* @return ImgType
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name.
*
* @return string
*/
public function getName()
{
return $this->name;
}
public function __toString(): string
{
return $this->name;
}
}