src/Entity/ItemPromotion.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\CommonTrait;
  4. use App\Repository\ItemPromotionRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ItemPromotionRepository::class)
  9.  * @ORM\Table(name="item_promo")
  10.  * @ORM\HasLifecycleCallbacks()
  11.  * @UniqueEntity({"uuid"})
  12.  */
  13. class ItemPromotion
  14. {
  15.     use CommonTrait;
  16.     const LIST_BIG_PROMO 'LIST_BIG_PROMO';
  17.     const HOME_PROMO 'HOME_PROMO';
  18.     const TOP_LIST_PROMO 'TOP_LIST_PROMO';
  19.     const LIST_SHADOW_PROMO 'LIST_SHADOW_PROMO';
  20.     const LIST_URGENT 'LIST_URGENT';
  21.     const PROMOTIONS = [
  22.         'Wyróżenienie (duże zdjęcie)' => self::LIST_BIG_PROMO,
  23.         'Oferta na stronie głównej' => self::HOME_PROMO,
  24.         'Złota ramka' => self::LIST_SHADOW_PROMO,
  25.         'Promowanie - wyróżnienie na górze listy wyników' => self::TOP_LIST_PROMO,
  26.         'Etykieta (Pilne)' => self::LIST_URGENT,
  27.         '' => ''
  28.     ];
  29.     const PROMOTIONS_NAMES = [
  30.         self::LIST_BIG_PROMO => 'Wyróżenienie (duże zdjęcie)',
  31.         self::HOME_PROMO => 'Oferta na stronie głównej',
  32.         self::LIST_SHADOW_PROMO => 'Złota ramka',
  33.         self::TOP_LIST_PROMO => 'Promowanie - wyróżnienie na górze listy wyników',
  34.         self::LIST_URGENT => 'Etykieta (Pilne)',
  35.         '' => '-- --'
  36.     ];
  37.     /**
  38.      * @ORM\Column(type="string", length=255)
  39.      */
  40.     private $name;
  41.     /**
  42.      * @ORM\Column(type="text", nullable=true)
  43.      */
  44.     private $description;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $uKey;
  49.     /**
  50.      * @ORM\Column(type="integer", nullable=true)
  51.      */
  52.     private $duration;
  53.     /**
  54.      * @ORM\Column(type="decimal", precision=10, scale=2)
  55.      */
  56.     private $defaultPrice;
  57.     public function getName(): ?string
  58.     {
  59.         return $this->name;
  60.     }
  61.     public function setName(string $name): self
  62.     {
  63.         $this->name $name;
  64.         return $this;
  65.     }
  66.     public function getDescription(): ?string
  67.     {
  68.         return $this->description;
  69.     }
  70.     public function setDescription(?string $description): self
  71.     {
  72.         $this->description $description;
  73.         return $this;
  74.     }
  75.     public function getUKey(): ?string
  76.     {
  77.         return $this->uKey;
  78.     }
  79.     public function setUKey(?string $uKey): self
  80.     {
  81.         $this->uKey $uKey;
  82.         return $this;
  83.     }
  84.     public function getDuration(): ?string
  85.     {
  86.         return $this->duration;
  87.     }
  88.     public function setDuration(?int $duration): self
  89.     {
  90.         $this->duration $duration;
  91.         return $this;
  92.     }
  93.     public function getDefaultPrice(): ?string
  94.     {
  95.         return $this->defaultPrice;
  96.     }
  97.     public function setDefaultPrice(string $defaultPrice): self
  98.     {
  99.         $this->defaultPrice $defaultPrice;
  100.         return $this;
  101.     }
  102.     public function __toString() {
  103.         return $this->name;
  104.     }
  105. }