<?php
namespace Customize\Entity;
use Doctrine\ORM\Mapping as ORM;
use Eccube\Entity\Product;
/**
* Short url
*
* @ORM\Entity
* @ORM\Table(name="dtb_short_urls")
* @ORM\Entity(repositoryClass="Customize\Repository\ShortUrlRepository")
*/
class ShortUrl extends \Eccube\Entity\AbstractEntity
{
/**
* @var int
* @ORM\Column(name="id", type="integer", options={"unsigned":true})
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
* @ORM\Column(name="url_key", type="string", length=255)
*/
private $url_key;
/**
* @var integer
* @ORM\Column(name="redirect_cart", type="integer", length=4, nullable=true)
*/
private $redirect_cart;
/**
* @var \DateTime
*
* @ORM\Column(name="create_date", nullable=true, type="datetimetz")
*/
private $create_date;
/**
* @var \DateTime
*
* @ORM\Column(name="update_date", nullable=true, type="datetimetz")
*/
private $update_date;
/**
* @ORM\OneToOne(targetEntity="Eccube\Entity\Product", inversedBy="ShortUrl")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="product_id", referencedColumnName="id")
* })
*/
private $product;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="Customize\Entity\ShortUrlVisit", mappedBy="ShortUrl", cascade={"persist","remove"})
*/
private $ShortUrlVisit;
/**
* @return string
*/
public function __toString()
{
return (string)$this->getUrlkey();
}
public function getId()
{
return $this->id;
}
public function getUrlkey()
{
return $this->url_key;
}
public function setUrlKey($value)
{
$this->url_key = $value;
return $this;
}
public function getRedirectCart()
{
return $this->redirect_cart;
}
public function setRedirectCart($value)
{
$this->redirect_cart = $value;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getShortUrlVisit()
{
return $this->ShortUrlVisit;
}
public function setShortUrlVisit($value)
{
$this->ShortUrlVisit = $value;
return $this;
}
/**
* Set createDate.
*
* @param \DateTime $createDate
*
* @return ShortUrl
*/
public function setCreateDate($createDate)
{
$this->create_date = $createDate;
return $this;
}
/**
* Get createDate.
*
* @return \DateTime
*/
public function getCreateDate()
{
return $this->create_date;
}
/**
* Set updateDate.
*
* @param \DateTime $updateDate
*
* @return ShortUrl
*/
public function setUpdateDate($updateDate)
{
$this->update_date = $updateDate;
return $this;
}
/**
* Get updateDate.
*
* @return \DateTime
*/
public function getUpdateDate()
{
return $this->update_date;
}
}