src/Eccube/Entity/Payment.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\Payment')) {
  15.     /**
  16.      * Payment
  17.      *
  18.      * @ORM\Table(name="dtb_payment")
  19.      * @ORM\InheritanceType("SINGLE_TABLE")
  20.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  21.      * @ORM\HasLifecycleCallbacks()
  22.      * @ORM\Entity(repositoryClass="Eccube\Repository\PaymentRepository")
  23.      */
  24.     class Payment extends \Eccube\Entity\AbstractEntity
  25.     {
  26.         /**
  27.          * @return string
  28.          */
  29.         public function __toString()
  30.         {
  31.             return (string) $this->getMethod();
  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="payment_method", type="string", length=255, nullable=true)
  45.          */
  46.         private $method;
  47.         /**
  48.          * @var string|null
  49.          *
  50.          * @ORM\Column(name="charge", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true,"default":0})
  51.          */
  52.         private $charge 0;
  53.         /**
  54.          * @var string|null
  55.          *
  56.          * @ORM\Column(name="rule_max", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true})
  57.          */
  58.         private $rule_max;
  59.         /**
  60.          * @var int|null
  61.          *
  62.          * @ORM\Column(name="sort_no", type="smallint", nullable=true, options={"unsigned":true})
  63.          */
  64.         private $sort_no;
  65.         /**
  66.          * @var boolean
  67.          *
  68.          * @ORM\Column(name="fixed", type="boolean", options={"default":true})
  69.          */
  70.         private $fixed true;
  71.         /**
  72.          * @var string|null
  73.          *
  74.          * @ORM\Column(name="payment_image", type="string", length=255, nullable=true)
  75.          */
  76.         private $payment_image;
  77.         /**
  78.          * @var string|null
  79.          *
  80.          * @ORM\Column(name="rule_min", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true})
  81.          */
  82.         private $rule_min;
  83.         /**
  84.          * @var string|null
  85.          *
  86.          * @ORM\Column(name="method_class", type="string", length=255, nullable=true)
  87.          */
  88.         private $method_class;
  89.         /**
  90.          * @var int
  91.          *
  92.          * @ORM\Column(name="visible", type="boolean", options={"default":true})
  93.          */
  94.         private $visible;
  95.         /**
  96.          * @var \DateTime
  97.          *
  98.          * @ORM\Column(name="create_date", type="datetimetz")
  99.          */
  100.         private $create_date;
  101.         /**
  102.          * @var \DateTime
  103.          *
  104.          * @ORM\Column(name="update_date", type="datetimetz")
  105.          */
  106.         private $update_date;
  107.         /**
  108.          * @var \Doctrine\Common\Collections\Collection
  109.          *
  110.          * @ORM\OneToMany(targetEntity="Eccube\Entity\PaymentOption", mappedBy="Payment")
  111.          */
  112.         private $PaymentOptions;
  113.         /**
  114.          * @var \Eccube\Entity\Member
  115.          *
  116.          * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
  117.          * @ORM\JoinColumns({
  118.          *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
  119.          * })
  120.          */
  121.         private $Creator;
  122.         /**
  123.          * Constructor
  124.          */
  125.         public function __construct()
  126.         {
  127.             $this->PaymentOptions = new \Doctrine\Common\Collections\ArrayCollection();
  128.         }
  129.         /**
  130.          * Get id.
  131.          *
  132.          * @return int
  133.          */
  134.         public function getId()
  135.         {
  136.             return $this->id;
  137.         }
  138.         /**
  139.          * Set method.
  140.          *
  141.          * @param string|null $method
  142.          *
  143.          * @return Payment
  144.          */
  145.         public function setMethod($method null)
  146.         {
  147.             $this->method $method;
  148.             return $this;
  149.         }
  150.         /**
  151.          * Get method.
  152.          *
  153.          * @return string|null
  154.          */
  155.         public function getMethod()
  156.         {
  157.             return $this->method;
  158.         }
  159.         /**
  160.          * Set charge.
  161.          *
  162.          * @param string|null $charge
  163.          *
  164.          * @return Payment
  165.          */
  166.         public function setCharge($charge null)
  167.         {
  168.             $this->charge $charge;
  169.             return $this;
  170.         }
  171.         /**
  172.          * Get charge.
  173.          *
  174.          * @return string|null
  175.          */
  176.         public function getCharge()
  177.         {
  178.             return $this->charge;
  179.         }
  180.         /**
  181.          * Set ruleMax.
  182.          *
  183.          * @param string|null $ruleMax
  184.          *
  185.          * @return Payment
  186.          */
  187.         public function setRuleMax($ruleMax null)
  188.         {
  189.             $this->rule_max $ruleMax;
  190.             return $this;
  191.         }
  192.         /**
  193.          * Get ruleMax.
  194.          *
  195.          * @return string|null
  196.          */
  197.         public function getRuleMax()
  198.         {
  199.             return $this->rule_max;
  200.         }
  201.         /**
  202.          * Set sortNo.
  203.          *
  204.          * @param int|null $sortNo
  205.          *
  206.          * @return Payment
  207.          */
  208.         public function setSortNo($sortNo null)
  209.         {
  210.             $this->sort_no $sortNo;
  211.             return $this;
  212.         }
  213.         /**
  214.          * Get sortNo.
  215.          *
  216.          * @return int|null
  217.          */
  218.         public function getSortNo()
  219.         {
  220.             return $this->sort_no;
  221.         }
  222.         /**
  223.          * Set fixed.
  224.          *
  225.          * @param boolean $fixed
  226.          *
  227.          * @return Payment
  228.          */
  229.         public function setFixed($fixed)
  230.         {
  231.             $this->fixed $fixed;
  232.             return $this;
  233.         }
  234.         /**
  235.          * Get fixed.
  236.          *
  237.          * @return boolean
  238.          */
  239.         public function isFixed()
  240.         {
  241.             return $this->fixed;
  242.         }
  243.         /**
  244.          * Set paymentImage.
  245.          *
  246.          * @param string|null $paymentImage
  247.          *
  248.          * @return Payment
  249.          */
  250.         public function setPaymentImage($paymentImage null)
  251.         {
  252.             $this->payment_image $paymentImage;
  253.             return $this;
  254.         }
  255.         /**
  256.          * Get paymentImage.
  257.          *
  258.          * @return string|null
  259.          */
  260.         public function getPaymentImage()
  261.         {
  262.             return $this->payment_image;
  263.         }
  264.         /**
  265.          * Set ruleMin.
  266.          *
  267.          * @param string|null $ruleMin
  268.          *
  269.          * @return Payment
  270.          */
  271.         public function setRuleMin($ruleMin null)
  272.         {
  273.             $this->rule_min $ruleMin;
  274.             return $this;
  275.         }
  276.         /**
  277.          * Get ruleMin.
  278.          *
  279.          * @return string|null
  280.          */
  281.         public function getRuleMin()
  282.         {
  283.             return $this->rule_min;
  284.         }
  285.         /**
  286.          * Set methodClass.
  287.          *
  288.          * @param string|null $methodClass
  289.          *
  290.          * @return Payment
  291.          */
  292.         public function setMethodClass($methodClass null)
  293.         {
  294.             $this->method_class $methodClass;
  295.             return $this;
  296.         }
  297.         /**
  298.          * Get methodClass.
  299.          *
  300.          * @return string|null
  301.          */
  302.         public function getMethodClass()
  303.         {
  304.             return $this->method_class;
  305.         }
  306.         /**
  307.          * @return integer
  308.          */
  309.         public function isVisible()
  310.         {
  311.             return $this->visible;
  312.         }
  313.         /**
  314.          * @param boolean $visible
  315.          *
  316.          * @return Payment
  317.          */
  318.         public function setVisible($visible)
  319.         {
  320.             $this->visible $visible;
  321.             return $this;
  322.         }
  323.         /**
  324.          * Set createDate.
  325.          *
  326.          * @param \DateTime $createDate
  327.          *
  328.          * @return Payment
  329.          */
  330.         public function setCreateDate($createDate)
  331.         {
  332.             $this->create_date $createDate;
  333.             return $this;
  334.         }
  335.         /**
  336.          * Get createDate.
  337.          *
  338.          * @return \DateTime
  339.          */
  340.         public function getCreateDate()
  341.         {
  342.             return $this->create_date;
  343.         }
  344.         /**
  345.          * Set updateDate.
  346.          *
  347.          * @param \DateTime $updateDate
  348.          *
  349.          * @return Payment
  350.          */
  351.         public function setUpdateDate($updateDate)
  352.         {
  353.             $this->update_date $updateDate;
  354.             return $this;
  355.         }
  356.         /**
  357.          * Get updateDate.
  358.          *
  359.          * @return \DateTime
  360.          */
  361.         public function getUpdateDate()
  362.         {
  363.             return $this->update_date;
  364.         }
  365.         /**
  366.          * Add paymentOption.
  367.          *
  368.          * @param \Eccube\Entity\PaymentOption $paymentOption
  369.          *
  370.          * @return Payment
  371.          */
  372.         public function addPaymentOption(PaymentOption $paymentOption)
  373.         {
  374.             $this->PaymentOptions[] = $paymentOption;
  375.             return $this;
  376.         }
  377.         /**
  378.          * Remove paymentOption.
  379.          *
  380.          * @param \Eccube\Entity\PaymentOption $paymentOption
  381.          *
  382.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  383.          */
  384.         public function removePaymentOption(PaymentOption $paymentOption)
  385.         {
  386.             return $this->PaymentOptions->removeElement($paymentOption);
  387.         }
  388.         /**
  389.          * Get paymentOptions.
  390.          *
  391.          * @return \Doctrine\Common\Collections\Collection
  392.          */
  393.         public function getPaymentOptions()
  394.         {
  395.             return $this->PaymentOptions;
  396.         }
  397.         /**
  398.          * Set creator.
  399.          *
  400.          * @param \Eccube\Entity\Member|null $creator
  401.          *
  402.          * @return Payment
  403.          */
  404.         public function setCreator(Member $creator null)
  405.         {
  406.             $this->Creator $creator;
  407.             return $this;
  408.         }
  409.         /**
  410.          * Get creator.
  411.          *
  412.          * @return \Eccube\Entity\Member|null
  413.          */
  414.         public function getCreator()
  415.         {
  416.             return $this->Creator;
  417.         }
  418.     }
  419. }