src/Eccube/Entity/Delivery.php line 28

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Eccube\Entity;
  13. use Doctrine\ORM\Mapping as ORM;
  14. if (!class_exists('\Eccube\Entity\Delivery')) {
  15.     /**
  16.      * Delivery
  17.      *
  18.      * @ORM\Table(name="dtb_delivery")
  19.      * @ORM\InheritanceType("SINGLE_TABLE")
  20.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21.      * @ORM\HasLifecycleCallbacks()
  22.      * @ORM\Entity(repositoryClass="Eccube\Repository\DeliveryRepository")
  23.      */
  24.     class Delivery extends \Eccube\Entity\AbstractEntity
  25.     {
  26.         /**
  27.          * @return string
  28.          */
  29.         public function __toString()
  30.         {
  31.             return (string) $this->name;
  32.         }
  33.         /**
  34.          * @var int
  35.          *
  36.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  37.          * @ORM\Id
  38.          * @ORM\GeneratedValue(strategy="IDENTITY")
  39.          */
  40.         private $id;
  41.         /**
  42.          * @var string|null
  43.          *
  44.          * @ORM\Column(name="name", type="string", length=255, nullable=true)
  45.          */
  46.         private $name;
  47.         /**
  48.          * @var string|null
  49.          *
  50.          * @ORM\Column(name="service_name", type="string", length=255, nullable=true)
  51.          */
  52.         private $service_name;
  53.         /**
  54.          * @var string|null
  55.          *
  56.          * @ORM\Column(name="description", type="string", length=4000, nullable=true)
  57.          */
  58.         private $description;
  59.         /**
  60.          * @var string|null
  61.          *
  62.          * @ORM\Column(name="confirm_url", type="string", length=4000, nullable=true)
  63.          */
  64.         private $confirm_url;
  65.         /**
  66.          * @var int|null
  67.          *
  68.          * @ORM\Column(name="sort_no", type="integer", nullable=true, options={"unsigned":true})
  69.          */
  70.         private $sort_no;
  71.         /**
  72.          * @var boolean
  73.          *
  74.          * @ORM\Column(name="visible", type="boolean", options={"default":true})
  75.          */
  76.         private $visible true;
  77.         /**
  78.          * @var \DateTime
  79.          *
  80.          * @ORM\Column(name="create_date", type="datetimetz")
  81.          */
  82.         private $create_date;
  83.         /**
  84.          * @var \DateTime
  85.          *
  86.          * @ORM\Column(name="update_date", type="datetimetz")
  87.          */
  88.         private $update_date;
  89.         /**
  90.          * @var \Doctrine\Common\Collections\Collection
  91.          *
  92.          * @ORM\OneToMany(targetEntity="Eccube\Entity\PaymentOption", mappedBy="Delivery", cascade={"persist","remove"})
  93.          */
  94.         private $PaymentOptions;
  95.         /**
  96.          * @var \Doctrine\Common\Collections\Collection
  97.          *
  98.          * @ORM\OneToMany(targetEntity="Eccube\Entity\DeliveryFee", mappedBy="Delivery", cascade={"persist","remove"})
  99.          */
  100.         private $DeliveryFees;
  101.         /**
  102.          * @var \Doctrine\Common\Collections\Collection
  103.          *
  104.          * @ORM\OneToMany(targetEntity="Eccube\Entity\DeliveryTime", mappedBy="Delivery", cascade={"persist","remove"})
  105.          * @ORM\OrderBy({
  106.          *     "sort_no"="ASC"
  107.          * })
  108.          */
  109.         private $DeliveryTimes;
  110.         /**
  111.          * @var \Eccube\Entity\Member
  112.          *
  113.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  114.          * @ORM\JoinColumns({
  115.          *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  116.          * })
  117.          */
  118.         private $Creator;
  119.         /**
  120.          * @var \Eccube\Entity\Master\SaleType
  121.          *
  122.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\SaleType")
  123.          * @ORM\JoinColumns({
  124.          *   @ORM\JoinColumn(name="sale_type_id", referencedColumnName="id")
  125.          * })
  126.          */
  127.         private $SaleType;
  128.         /**
  129.          * Constructor
  130.          */
  131.         public function __construct()
  132.         {
  133.             $this->PaymentOptions = new \Doctrine\Common\Collections\ArrayCollection();
  134.             $this->DeliveryFees = new \Doctrine\Common\Collections\ArrayCollection();
  135.             $this->DeliveryTimes = new \Doctrine\Common\Collections\ArrayCollection();
  136.         }
  137.         /**
  138.          * Get id.
  139.          *
  140.          * @return int
  141.          */
  142.         public function getId()
  143.         {
  144.             return $this->id;
  145.         }
  146.         /**
  147.          * Set name.
  148.          *
  149.          * @param string|null $name
  150.          *
  151.          * @return Delivery
  152.          */
  153.         public function setName($name null)
  154.         {
  155.             $this->name $name;
  156.             return $this;
  157.         }
  158.         /**
  159.          * Get name.
  160.          *
  161.          * @return string|null
  162.          */
  163.         public function getName()
  164.         {
  165.             return $this->name;
  166.         }
  167.         /**
  168.          * Set serviceName.
  169.          *
  170.          * @param string|null $serviceName
  171.          *
  172.          * @return Delivery
  173.          */
  174.         public function setServiceName($serviceName null)
  175.         {
  176.             $this->service_name $serviceName;
  177.             return $this;
  178.         }
  179.         /**
  180.          * Get serviceName.
  181.          *
  182.          * @return string|null
  183.          */
  184.         public function getServiceName()
  185.         {
  186.             return $this->service_name;
  187.         }
  188.         /**
  189.          * Set description.
  190.          *
  191.          * @param string|null $description
  192.          *
  193.          * @return Delivery
  194.          */
  195.         public function setDescription($description null)
  196.         {
  197.             $this->description $description;
  198.             return $this;
  199.         }
  200.         /**
  201.          * Get description.
  202.          *
  203.          * @return string|null
  204.          */
  205.         public function getDescription()
  206.         {
  207.             return $this->description;
  208.         }
  209.         /**
  210.          * Set confirmUrl.
  211.          *
  212.          * @param string|null $confirmUrl
  213.          *
  214.          * @return Delivery
  215.          */
  216.         public function setConfirmUrl($confirmUrl null)
  217.         {
  218.             $this->confirm_url $confirmUrl;
  219.             return $this;
  220.         }
  221.         /**
  222.          * Get confirmUrl.
  223.          *
  224.          * @return string|null
  225.          */
  226.         public function getConfirmUrl()
  227.         {
  228.             return $this->confirm_url;
  229.         }
  230.         /**
  231.          * Set sortNo.
  232.          *
  233.          * @param int|null $sortNo
  234.          *
  235.          * @return Delivery
  236.          */
  237.         public function setSortNo($sortNo null)
  238.         {
  239.             $this->sort_no $sortNo;
  240.             return $this;
  241.         }
  242.         /**
  243.          * Get sortNo.
  244.          *
  245.          * @return int|null
  246.          */
  247.         public function getSortNo()
  248.         {
  249.             return $this->sort_no;
  250.         }
  251.         /**
  252.          * Set createDate.
  253.          *
  254.          * @param \DateTime $createDate
  255.          *
  256.          * @return Delivery
  257.          */
  258.         public function setCreateDate($createDate)
  259.         {
  260.             $this->create_date $createDate;
  261.             return $this;
  262.         }
  263.         /**
  264.          * Get createDate.
  265.          *
  266.          * @return \DateTime
  267.          */
  268.         public function getCreateDate()
  269.         {
  270.             return $this->create_date;
  271.         }
  272.         /**
  273.          * Set updateDate.
  274.          *
  275.          * @param \DateTime $updateDate
  276.          *
  277.          * @return Delivery
  278.          */
  279.         public function setUpdateDate($updateDate)
  280.         {
  281.             $this->update_date $updateDate;
  282.             return $this;
  283.         }
  284.         /**
  285.          * Get updateDate.
  286.          *
  287.          * @return \DateTime
  288.          */
  289.         public function getUpdateDate()
  290.         {
  291.             return $this->update_date;
  292.         }
  293.         /**
  294.          * Add paymentOption.
  295.          *
  296.          * @param \Eccube\Entity\PaymentOption $paymentOption
  297.          *
  298.          * @return Delivery
  299.          */
  300.         public function addPaymentOption(PaymentOption $paymentOption)
  301.         {
  302.             $this->PaymentOptions[] = $paymentOption;
  303.             return $this;
  304.         }
  305.         /**
  306.          * Remove paymentOption.
  307.          *
  308.          * @param \Eccube\Entity\PaymentOption $paymentOption
  309.          *
  310.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  311.          */
  312.         public function removePaymentOption(PaymentOption $paymentOption)
  313.         {
  314.             return $this->PaymentOptions->removeElement($paymentOption);
  315.         }
  316.         /**
  317.          * Get paymentOptions.
  318.          *
  319.          * @return \Doctrine\Common\Collections\Collection
  320.          */
  321.         public function getPaymentOptions()
  322.         {
  323.             return $this->PaymentOptions;
  324.         }
  325.         /**
  326.          * Add deliveryFee.
  327.          *
  328.          * @param \Eccube\Entity\DeliveryFee $deliveryFee
  329.          *
  330.          * @return Delivery
  331.          */
  332.         public function addDeliveryFee(DeliveryFee $deliveryFee)
  333.         {
  334.             $this->DeliveryFees[] = $deliveryFee;
  335.             return $this;
  336.         }
  337.         /**
  338.          * Remove deliveryFee.
  339.          *
  340.          * @param \Eccube\Entity\DeliveryFee $deliveryFee
  341.          *
  342.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  343.          */
  344.         public function removeDeliveryFee(DeliveryFee $deliveryFee)
  345.         {
  346.             return $this->DeliveryFees->removeElement($deliveryFee);
  347.         }
  348.         /**
  349.          * Get deliveryFees.
  350.          *
  351.          * @return \Doctrine\Common\Collections\Collection
  352.          */
  353.         public function getDeliveryFees()
  354.         {
  355.             return $this->DeliveryFees;
  356.         }
  357.         /**
  358.          * Add deliveryTime.
  359.          *
  360.          * @param \Eccube\Entity\DeliveryTime $deliveryTime
  361.          *
  362.          * @return Delivery
  363.          */
  364.         public function addDeliveryTime(DeliveryTime $deliveryTime)
  365.         {
  366.             $this->DeliveryTimes[] = $deliveryTime;
  367.             return $this;
  368.         }
  369.         /**
  370.          * Remove deliveryTime.
  371.          *
  372.          * @param \Eccube\Entity\DeliveryTime $deliveryTime
  373.          *
  374.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  375.          */
  376.         public function removeDeliveryTime(DeliveryTime $deliveryTime)
  377.         {
  378.             return $this->DeliveryTimes->removeElement($deliveryTime);
  379.         }
  380.         /**
  381.          * Get deliveryTimes.
  382.          *
  383.          * @return \Doctrine\Common\Collections\Collection
  384.          */
  385.         public function getDeliveryTimes()
  386.         {
  387.             return $this->DeliveryTimes;
  388.         }
  389.         /**
  390.          * Set creator.
  391.          *
  392.          * @param \Eccube\Entity\Member|null $creator
  393.          *
  394.          * @return Delivery
  395.          */
  396.         public function setCreator(Member $creator null)
  397.         {
  398.             $this->Creator $creator;
  399.             return $this;
  400.         }
  401.         /**
  402.          * Get creator.
  403.          *
  404.          * @return \Eccube\Entity\Member|null
  405.          */
  406.         public function getCreator()
  407.         {
  408.             return $this->Creator;
  409.         }
  410.         /**
  411.          * Set saleType.
  412.          *
  413.          * @param \Eccube\Entity\Master\SaleType|null $saleType
  414.          *
  415.          * @return Delivery
  416.          */
  417.         public function setSaleType(Master\SaleType $saleType null)
  418.         {
  419.             $this->SaleType $saleType;
  420.             return $this;
  421.         }
  422.         /**
  423.          * Get saleType.
  424.          *
  425.          * @return \Eccube\Entity\Master\SaleType|null
  426.          */
  427.         public function getSaleType()
  428.         {
  429.             return $this->SaleType;
  430.         }
  431.         /**
  432.          * Set visible
  433.          *
  434.          * @param boolean $visible
  435.          *
  436.          * @return Delivery
  437.          */
  438.         public function setVisible($visible)
  439.         {
  440.             $this->visible $visible;
  441.             return $this;
  442.         }
  443.         /**
  444.          * Is the visibility visible?
  445.          *
  446.          * @return boolean
  447.          */
  448.         public function isVisible()
  449.         {
  450.             return $this->visible;
  451.         }
  452.     }
  453. }