src/Entity/Image/ImgType.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Image;
  3. use App\Repository\Image\ImgTypeRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * ImgType
  7.  */
  8. #[ORM\Table(name'img_type')]
  9. #[ORM\Entity(repositoryClassImgTypeRepository::class)]
  10. class ImgType implements \Stringable
  11. {
  12.     #[ORM\Column(name'id'type'integer')]
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue(strategy'AUTO')]
  15.     private ?int $id null;
  16.     #[ORM\Column(name'name'type'string'length255)]
  17.     private ?string $name null;
  18.     #[ORM\OneToMany(targetEntityImage::class, mappedBy'type')]
  19.     protected $images;
  20.     /**
  21.      * Get id.
  22.      *
  23.      * @return int
  24.      */
  25.     public function getId()
  26.     {
  27.         return $this->id;
  28.     }
  29.     /**
  30.      * Set name.
  31.      *
  32.      * @param string $name
  33.      *
  34.      * @return ImgType
  35.      */
  36.     public function setName($name)
  37.     {
  38.         $this->name $name;
  39.         return $this;
  40.     }
  41.     /**
  42.      * Get name.
  43.      *
  44.      * @return string
  45.      */
  46.     public function getName()
  47.     {
  48.         return $this->name;
  49.     }
  50.     public function __toString(): string
  51.     {
  52.         return $this->name;
  53.     }
  54. }