src/Entity/Gos/ShortUrl.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * ShortUel
  6.  *
  7.  * @ORM\Table(name="short_url")
  8.  * @ORM\Entity(repositoryClass="App\Repository\ShortUrlRepository")
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class ShortUrl
  12. {
  13.     const SHORT_DOMAIN 'https://fmp.pl/';
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="datetime")
  22.      */
  23.     private $createdAt;
  24.     /**
  25.      * @ORM\Column(type="text")
  26.      */
  27.     private $full;
  28.     /**
  29.      * @ORM\Column(type="string", length=190, unique=true)
  30.      */
  31.     private $short;
  32.     /**
  33.      * @ORM\Column(type="integer", options={"default" : 0})
  34.      */
  35.     private $redirects;
  36.     /**
  37.      * @ORM\Column(type="text", nullable=true)
  38.      */
  39.     private $comment;
  40.     /**
  41.      * Get id
  42.      *
  43.      * @return integer
  44.      */
  45.     public function getId()
  46.     {
  47.         return $this->id;
  48.     }
  49.     /** @ORM\PrePersist() */
  50.     public function prePersist()
  51.     {
  52.         $this->createdAt = new \DateTime();
  53.     }
  54.     /**
  55.      * Set createdAt
  56.      *
  57.      * @param \DateTime $createdAt
  58.      *
  59.      * @return ShortUrl
  60.      */
  61.     public function setCreatedAt($createdAt)
  62.     {
  63.         $this->createdAt $createdAt;
  64.         return $this;
  65.     }
  66.     /**
  67.      * Get createdAt
  68.      *
  69.      * @return \DateTime
  70.      */
  71.     public function getCreatedAt()
  72.     {
  73.         return $this->createdAt;
  74.     }
  75.     /**
  76.      * Set full
  77.      *
  78.      * @param String $fullUrl
  79.      *
  80.      * @return ShortUrl
  81.      */
  82.     public function setFull($fullUrl)
  83.     {
  84.         $this->full $fullUrl;
  85.         return $this;
  86.     }
  87.     /**
  88.      * Get full
  89.      *
  90.      * @return String
  91.      */
  92.     public function getFull()
  93.     {
  94.         return $this->full;
  95.     }
  96.     /**
  97.      * Set shortUrl
  98.      *
  99.      * @param String $shortUrl
  100.      *
  101.      * @return ShortUrl
  102.      */
  103.     public function setShort($shortUrl)
  104.     {
  105.         $this->short $shortUrl;
  106.         return $this;
  107.     }
  108.     /**
  109.      * Get short
  110.      *
  111.      * @return String
  112.      */
  113.     public function getShort()
  114.     {
  115.         return $this->short;
  116.     }
  117.     /**
  118.      * Set redirects
  119.      *
  120.      * @param Int $currentCount
  121.      *
  122.      * @return ShortUrl
  123.      */
  124.     public function setRedirects($currentCount)
  125.     {
  126.         $this->redirects $currentCount;
  127.         return $this;
  128.     }
  129.     /**
  130.      * Get redirects
  131.      *
  132.      * @return String
  133.      */
  134.     public function getRedirects()
  135.     {
  136.         return $this->redirects;
  137.     }
  138.     public function getComment(): ?string
  139.     {
  140.         return $this->comment;
  141.     }
  142.     public function setComment(?string $comment): self
  143.     {
  144.         $this->comment $comment;
  145.         return $this;
  146.     }
  147. }