src/Entity/ShortCode.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ShortCodeRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=ShortCodeRepository::class)
  7.  */
  8. class ShortCode
  9. {
  10.     const UNIT_PRICE 0.031256;
  11.     const FULL_HOST_NAME "https://go0.cz";
  12.     const SHORT_HOST_NAME "go0.cz";
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $redirect_to_url;
  23.     /**
  24.      * @ORM\Column(type="text", nullable=true)
  25.      */
  26.     private $description;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $short_url;
  31.     /**
  32.      * @ORM\Column(type="string", length=255)
  33.      */
  34.     private $qr_value;
  35.     /**
  36.      * @ORM\Column(type="text")
  37.      */
  38.     private $qr_image_base64;
  39.     /**
  40.      * @ORM\Column(type="string", length=500)
  41.      */
  42.     private $qr_image_url;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="shortCodes")
  45.      * @ORM\JoinColumn(nullable=false)
  46.      */
  47.     private $user;
  48.     /**
  49.      * @ORM\Column(type="datetime")
  50.      */
  51.     private $date_added;
  52.     /**
  53.      * @ORM\Column(type="datetime", nullable=true)
  54.      */
  55.     private $date_updated;
  56.     /**
  57.      * @ORM\Column(type="integer")
  58.      */
  59.     private $visits;
  60.     /**
  61.      * @ORM\Column(type="string", length=255)
  62.      */
  63.     private $redirect_code;
  64.     /**
  65.      * @ORM\Column(type="datetime")
  66.      */
  67.     private $expire_date;
  68.     public function getId(): ?int
  69.     {
  70.         return $this->id;
  71.     }
  72.     public function getRedirectToUrl(): ?string
  73.     {
  74.         return $this->redirect_to_url;
  75.     }
  76.     public function setRedirectToUrl(string $redirect_to_url): self
  77.     {
  78.         $this->redirect_to_url $redirect_to_url;
  79.         return $this;
  80.     }
  81.     public function getDescription(): ?string
  82.     {
  83.         return $this->description;
  84.     }
  85.     public function setDescription(?string $description): self
  86.     {
  87.         $this->description $description;
  88.         return $this;
  89.     }
  90.     public function getShortUrl(): ?string
  91.     {
  92.         return $this->short_url;
  93.     }
  94.     public function setShortUrl(string $short_url): self
  95.     {
  96.         $this->short_url $short_url;
  97.         return $this;
  98.     }
  99.     public function getQrValue(): ?string
  100.     {
  101.         return $this->qr_value;
  102.     }
  103.     public function setQrValue(string $qr_value): self
  104.     {
  105.         $this->qr_value $qr_value;
  106.         return $this;
  107.     }
  108.     public function getQrImageBase64(): ?string
  109.     {
  110.         return $this->qr_image_base64;
  111.     }
  112.     public function setQrImageBase64(string $qr_image_base64): self
  113.     {
  114.         $this->qr_image_base64 $qr_image_base64;
  115.         return $this;
  116.     }
  117.     public function getQrImageUrl(): ?string
  118.     {
  119.         return $this->qr_image_url;
  120.     }
  121.     public function setQrImageUrl(string $qr_image_url): self
  122.     {
  123.         $this->qr_image_url $qr_image_url;
  124.         return $this;
  125.     }
  126.     public function getUser(): ?User
  127.     {
  128.         return $this->user;
  129.     }
  130.     public function setUser(?User $user): self
  131.     {
  132.         $this->user $user;
  133.         return $this;
  134.     }
  135.     public function getDateAdded(): ?\DateTimeInterface
  136.     {
  137.         return $this->date_added;
  138.     }
  139.     public function setDateAdded(\DateTimeInterface $date_added): self
  140.     {
  141.         $this->date_added $date_added;
  142.         return $this;
  143.     }
  144.     public function getDateUpdated(): ?\DateTimeInterface
  145.     {
  146.         return $this->date_updated;
  147.     }
  148.     public function setDateUpdated(?\DateTimeInterface $date_updated): self
  149.     {
  150.         $this->date_updated $date_updated;
  151.         return $this;
  152.     }
  153.     public function getVisits(): ?int
  154.     {
  155.         return $this->visits;
  156.     }
  157.     public function setVisits(int $visits): self
  158.     {
  159.         $this->visits $visits;
  160.         return $this;
  161.     }
  162.     public function getRedirectCode(): ?string
  163.     {
  164.         return $this->redirect_code;
  165.     }
  166.     public function setRedirectCode(string $redirect_code): self
  167.     {
  168.         $this->redirect_code $redirect_code;
  169.         return $this;
  170.     }
  171.     public function getExpireDate(): ?\DateTimeInterface
  172.     {
  173.         return $this->expire_date;
  174.     }
  175.     public function setExpireDate(\DateTimeInterface $expire_date): self
  176.     {
  177.         $this->expire_date $expire_date;
  178.         return $this;
  179.     }
  180. }