app/Customize/Entity/ShortUrl.php line 15

Open in your IDE?
  1. <?php
  2. namespace Customize\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Eccube\Entity\Product;
  5. /**
  6.  * Short url
  7.  *
  8.  * @ORM\Entity
  9.  * @ORM\Table(name="dtb_short_urls")
  10.  * @ORM\Entity(repositoryClass="Customize\Repository\ShortUrlRepository")
  11.  */
  12. class ShortUrl extends \Eccube\Entity\AbstractEntity
  13. {
  14.     /**
  15.      * @var int
  16.      * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="IDENTITY")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var string
  23.      * @ORM\Column(name="url_key", type="string", length=255)
  24.      */
  25.     private $url_key;
  26.     /**
  27.      * @var integer
  28.      * @ORM\Column(name="redirect_cart", type="integer", length=4, nullable=true)
  29.      */
  30.     private $redirect_cart;
  31.     /**
  32.      * @var \DateTime
  33.      *
  34.      * @ORM\Column(name="create_date", nullable=true, type="datetimetz")
  35.      */
  36.     private $create_date;
  37.     /**
  38.      * @var \DateTime
  39.      *
  40.      * @ORM\Column(name="update_date", nullable=true, type="datetimetz")
  41.      */
  42.     private $update_date;
  43.     /**
  44.      * @ORM\OneToOne(targetEntity="Eccube\Entity\Product", inversedBy="ShortUrl")
  45.      * @ORM\JoinColumns({
  46.      *  @ORM\JoinColumn(name="product_id", referencedColumnName="id")
  47.      * })
  48.      */
  49.     private $product;
  50.     /**
  51.      * @var \Doctrine\Common\Collections\Collection
  52.      *
  53.      * @ORM\OneToMany(targetEntity="Customize\Entity\ShortUrlVisit", mappedBy="ShortUrl", cascade={"persist","remove"})
  54.      */
  55.     private $ShortUrlVisit;
  56.     /**
  57.      * @return string
  58.      */
  59.     public function __toString()
  60.     {
  61.         return (string)$this->getUrlkey();
  62.     }
  63.     public function getId()
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getUrlkey()
  68.     {
  69.         return $this->url_key;
  70.     }
  71.     public function setUrlKey($value)
  72.     {
  73.         $this->url_key $value;
  74.         return $this;
  75.     }
  76.     public function getRedirectCart()
  77.     {
  78.         return $this->redirect_cart;
  79.     }
  80.     public function setRedirectCart($value)
  81.     {
  82.         $this->redirect_cart $value;
  83.         return $this;
  84.     }
  85.     public function getProduct(): ?Product
  86.     {
  87.         return $this->product;
  88.     }
  89.     public function setProduct(?Product $product): self
  90.     {
  91.         $this->product $product;
  92.         return $this;
  93.     }
  94.     public function getShortUrlVisit()
  95.     {
  96.         return $this->ShortUrlVisit;
  97.     }
  98.     public function setShortUrlVisit($value)
  99.     {
  100.         $this->ShortUrlVisit $value;
  101.         return $this;
  102.     }
  103.     /**
  104.      * Set createDate.
  105.      *
  106.      * @param \DateTime $createDate
  107.      *
  108.      * @return ShortUrl
  109.      */
  110.     public function setCreateDate($createDate)
  111.     {
  112.         $this->create_date $createDate;
  113.         return $this;
  114.     }
  115.     /**
  116.      * Get createDate.
  117.      *
  118.      * @return \DateTime
  119.      */
  120.     public function getCreateDate()
  121.     {
  122.         return $this->create_date;
  123.     }
  124.     /**
  125.      * Set updateDate.
  126.      *
  127.      * @param \DateTime $updateDate
  128.      *
  129.      * @return ShortUrl
  130.      */
  131.     public function setUpdateDate($updateDate)
  132.     {
  133.         $this->update_date $updateDate;
  134.         return $this;
  135.     }
  136.     /**
  137.      * Get updateDate.
  138.      *
  139.      * @return \DateTime
  140.      */
  141.     public function getUpdateDate()
  142.     {
  143.         return $this->update_date;
  144.     }
  145. }