src/Entity/IceCream.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Trait\MainTranslationTrait;
  4. use App\Entity\Translation\IceCreamTranslation;
  5. use App\Repository\IceCreamRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Translatable\Translatable;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. #[ORM\Table(name'ice_cream')]
  10. #[ORM\Entity(repositoryClassIceCreamRepository::class)]
  11. #[Gedmo\TranslationEntity(class:IceCreamTranslation::class)]
  12. class IceCream implements Translatable
  13. {
  14.     use MainTranslationTrait;
  15.     const TRANSLATION_ENTITY IceCreamTranslation::class;
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[ORM\Column(type'string'nullabletrue)]
  21.     private ?string $color null;
  22.     #[ORM\Column(type'string'nullabletrue)]
  23.     private ?string $image null;
  24.     #[ORM\Column(type'string'nullabletrue)]
  25.     #[Gedmo\Translatable]
  26.     private ?string $title null;
  27.     #[ORM\Column(type'text'nullabletrue)]
  28.     #[Gedmo\Translatable]
  29.     private ?string $body null;
  30.     public function __toString(): string
  31.     {
  32.         return $this->title ?? "";
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getImage(): ?string
  39.     {
  40.         return $this->image;
  41.     }
  42.     public function setImage(?string $image): void
  43.     {
  44.         $this->image $image;
  45.     }
  46.     public function getTitle(): ?string
  47.     {
  48.         return $this->title;
  49.     }
  50.     public function setTitle(?string $title): void
  51.     {
  52.         $this->title $title;
  53.     }
  54.     public function getBody(): ?string
  55.     {
  56.         return $this->body;
  57.     }
  58.     public function setBody(?string $body): void
  59.     {
  60.         $this->body $body;
  61.     }
  62.     public function getColor(): ?string
  63.     {
  64.         return $this->color;
  65.     }
  66.     public function setColor(?string $color): void
  67.     {
  68.         $this->color $color;
  69.     }
  70. }