modules/RedSqui/GiftCertificates/src/Model/UseGiftCard.php line 45

Open in your IDE?
  1. <?php
  2. // vim: set ts=4 sw=4 sts=4 et:
  3. /**
  4.  * X-Cart
  5.  *
  6.  * NOTICE OF LICENSE
  7.  *
  8.  * This source file is subject to the software license agreement
  9.  * that is bundled with this package in the file LICENSE.txt.
  10.  * It is also available through the world-wide-web at this URL:
  11.  * http://www.litecommerce.com/module-eula.html
  12.  * If you did not receive a copy of the license and are unable to
  13.  * obtain it through the world-wide-web, please send an email
  14.  * to redsqui@gmail.com so we can send you a copy immediately.
  15.  *
  16.  * DISCLAIMER
  17.  *
  18.  * Do not modify this file if you wish to upgrade X-Cart to newer versions
  19.  * in the future. If you wish to customize X-Cart for your needs please
  20.  * refer to http://www.x-cart.com/ for more information.
  21.  *
  22.  *
  23.  * @category  X-Cart Next
  24.  * @author    Vladimir Serov <redsqui@gmail.com>
  25.  * @copyright Copyright (c) 2012-present Vladimir Serov <redsqui@gmail.com>. All rights reserved
  26.  * @license   http://www.litecommerce.com/module-eula.html LiteCommerce Module License Agreement
  27.  */
  28. namespace RedSqui\GiftCertificates\Model;
  29. use Doctrine\ORM\Mapping as ORM;
  30. /**
  31.  * Gift Certificates in orders
  32.  *
  33.  * @ORM\Entity (repositoryClass="\RedSqui\GiftCertificates\Model\Repo\UseGiftCard")
  34.  * @ORM\Table (name="gift_certificates_orders",
  35.  *           indexes={
  36.  *           @ORM\Index (name="order", columns={"order_id"}),
  37.  *           @ORM\Index (name="card", columns={"card_id"})
  38.  *           }
  39.  *   )
  40.  */
  41. class UseGiftCard extends \XLite\Model\AEntity
  42. {
  43.     /**
  44.      * id record
  45.      *
  46.      * @var integer
  47.      *
  48.      * @ORM\Id
  49.      * @ORM\GeneratedValue (strategy="AUTO")
  50.      * @ORM\Column         (type="integer")
  51.      */
  52.     protected $id '';
  53.     /**
  54.      * Order
  55.      *
  56.      * @var \XLite\Model\Order
  57.      *
  58.      * @ORM\ManyToOne  (targetEntity="XLite\Model\Order",cascade={"persist"})
  59.      * @ORM\JoinColumn (name="order_id", referencedColumnName="order_id", onDelete="CASCADE")
  60.      */
  61.     protected $order;
  62.     /**
  63.      * Card code
  64.      *
  65.      * @var integer
  66.      *
  67.      * @ORM\ManyToOne   (targetEntity="RedSqui\GiftCertificates\Model\GiftCerts")
  68.      * @ORM\JoinColumn (name="card_id", referencedColumnName="card_id")
  69.      */
  70.     protected $card '';
  71.     /**
  72.      * amount of payment by gift card
  73.      *
  74.      * @var float
  75.      *
  76.      * @ORM\Column (type="decimal", precision=14, scale=4)
  77.      */
  78.     protected $value 0.0000;
  79.     /**
  80.      * Name in panel.total
  81.      *
  82.      * @var string
  83.      *
  84.      * @ORM\Column (type="string")
  85.      */
  86.     protected $name '';
  87.     /**
  88.      * is used card
  89.      *
  90.      * @var boolean
  91.      *
  92.      * @ORM\Column (type="boolean", options={"default" = true})
  93.      */
  94.     protected $used true;
  95.     /**
  96.      * Get id
  97.      *
  98.      * @return integer
  99.      */
  100.     public function getId()
  101.     {
  102.         return $this->id;
  103.     }
  104.     /**
  105.      * Set value
  106.      *
  107.      * @param float $value
  108.      *
  109.      * @return UseGiftCard
  110.      */
  111.     public function setValue($value)
  112.     {
  113.         $this->value $value;
  114.         return $this;
  115.     }
  116.     /**
  117.      * Get value
  118.      *
  119.      * @return float
  120.      */
  121.     public function getValue()
  122.     {
  123.         return $this->value;
  124.     }
  125.     /**
  126.      * Set name
  127.      *
  128.      * @param string $name
  129.      *
  130.      * @return UseGiftCard
  131.      */
  132.     public function setName($name)
  133.     {
  134.         $this->name $name;
  135.         return $this;
  136.     }
  137.     /**
  138.      * Get name
  139.      *
  140.      * @return string
  141.      */
  142.     public function getName()
  143.     {
  144.         return $this->name;
  145.     }
  146.     /**
  147.      * Set used
  148.      *
  149.      * @param boolean $used
  150.      *
  151.      * @return UseGiftCard
  152.      */
  153.     public function setUsed($used)
  154.     {
  155.         $this->used $used;
  156.         return $this;
  157.     }
  158.     /**
  159.      * Get used
  160.      *
  161.      * @return boolean
  162.      */
  163.     public function getUsed()
  164.     {
  165.         return $this->used;
  166.     }
  167.     /**
  168.      * Set order
  169.      *
  170.      * @param \XLite\Model\Order $order
  171.      *
  172.      * @return UseGiftCard
  173.      */
  174.     public function setOrder(\XLite\Model\Order $order null)
  175.     {
  176.         $this->order $order;
  177.         return $this;
  178.     }
  179.     /**
  180.      * Get order
  181.      *
  182.      * @return \XLite\Model\Order
  183.      */
  184.     public function getOrder()
  185.     {
  186.         return $this->order;
  187.     }
  188.     /**
  189.      * Set card
  190.      *
  191.      * @param \RedSqui\GiftCertificates\Model\GiftCerts $card
  192.      * @return UseGiftCard
  193.      */
  194.     public function setCard(\RedSqui\GiftCertificates\Model\GiftCerts $card null)
  195.     {
  196.         $this->card $card;
  197.         return $this;
  198.     }
  199.     /**
  200.      * Get card
  201.      *
  202.      * @return \RedSqui\GiftCertificates\Model\GiftCerts
  203.      */
  204.     public function getCard()
  205.     {
  206.         return $this->card;
  207.     }
  208. }