src/Entity/Discount.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Translatable\Translatable;
  5. use App\Repository\DiscountRepository;
  6. use App\Entity\Translation\PageTranslation;
  7. use App\Entity\Translation\DiscountTranslation;
  8. use Gedmo\Mapping\Annotation\TranslationEntity;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Gedmo\Mapping\Annotation\Locale as GedmoLocale;
  11. use Gedmo\Mapping\Annotation\Translatable as GedmoTranslatable;
  12. #[ORM\Entity(repositoryClassDiscountRepository::class)]
  13. #[TranslationEntity(class: DiscountTranslation::class)]
  14. class Discount implements EntityInterface
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue]
  18.     #[ORM\Column]
  19.     private ?int $id null;
  20.     #[GedmoTranslatable]
  21.     #[ORM\Column(length255)]
  22.     private ?string $name '';
  23.     #[ORM\Column]
  24.     private ?int $value 0;
  25.     #[ORM\Column]
  26.     private ?int $nakop 0;
  27.     #[GedmoLocale]
  28.     private $locale;
  29.     #[ORM\OneToMany(targetEntityDiscountTranslation::class, mappedBy'object'cascade: ['persist''remove'])]
  30.     private $translations;
  31.     public function __construct()
  32.     {
  33.         $this->translations = new ArrayCollection();
  34.     }
  35.     public function setLocale($locale)
  36.     {
  37.         $this->locale $locale;
  38.     }
  39.     public function getTranslations()
  40.     {
  41.         return $this->translations;
  42.     }
  43.     public function addTranslation(DiscountTranslation $t)
  44.     {
  45.         if (!$this->translations->contains($t)) {
  46.             $this->translations[] = $t;
  47.             $t->setObject($this);
  48.         }
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getName(): ?string
  55.     {
  56.         return $this->name;
  57.     }
  58.     public function setName(string $name): self
  59.     {
  60.         $this->name $name;
  61.         return $this;
  62.     }
  63.     public function getValue(): ?int
  64.     {
  65.         return $this->value;
  66.     }
  67.     public function setValue(int $value): self
  68.     {
  69.         $this->value $value;
  70.         return $this;
  71.     }
  72.     public function getNakop(): ?int
  73.     {
  74.         return $this->nakop;
  75.     }
  76.     public function setNakop(int $nakop): self
  77.     {
  78.         $this->nakop $nakop;
  79.         return $this;
  80.     }
  81. }