src/Entity/ShortUrls.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ShortUrlsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=ShortUrlsRepository::class)
  7.  */
  8. class ShortUrls
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="text")
  18.      */
  19.     private $url;
  20.     /**
  21.      * @ORM\Column(type="string", length=50)
  22.      */
  23.     private $short_code;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=Users::class, inversedBy="shortUrls")
  26.      * @ORM\JoinColumn(nullable=false)
  27.      */
  28.     private $user;
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getUrl(): ?string
  34.     {
  35.         return $this->url;
  36.     }
  37.     public function setUrl(string $url): self
  38.     {
  39.         $this->url $url;
  40.         return $this;
  41.     }
  42.     public function getShortCode(): ?string
  43.     {
  44.         return $this->short_code;
  45.     }
  46.     public function setShortCode(string $short_code): self
  47.     {
  48.         $this->short_code $short_code;
  49.         return $this;
  50.     }
  51.     public function getUser(): ?Users
  52.     {
  53.         return $this->user;
  54.     }
  55.     public function setUser(?Users $user): self
  56.     {
  57.         $this->user $user;
  58.         return $this;
  59.     }
  60.     // public function getFullShortUrl(): string
  61.     // {
  62.     //     $short_base_url = $this->getParameter('app.short_url_base');
  63.     //     return $short_base_url .'/' . $this->short_code;
  64.     //     //return 'https://s.gdsk.in/' . $this->short_code;
  65.     // }
  66. }