classes/XLite/Model/OrderItem/Surcharge.php line 18

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2001-present X-Cart Holdings LLC. All rights reserved.
  4.  * See https://www.x-cart.com/license-agreement.html for license details.
  5.  */
  6. namespace XLite\Model\OrderItem;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * Surcharge
  10.  *
  11.  * @ORM\Entity
  12.  * @ORM\Table  (name="order_item_surcharges")
  13.  */
  14. class Surcharge extends \XLite\Model\Base\Surcharge
  15. {
  16.     /**
  17.      * Surcharge owner (order item)
  18.      *
  19.      * @var \XLite\Model\OrderItem
  20.      *
  21.      * @ORM\ManyToOne  (targetEntity="XLite\Model\OrderItem", inversedBy="surcharges")
  22.      * @ORM\JoinColumn (name="item_id", referencedColumnName="item_id", onDelete="CASCADE")
  23.      */
  24.     protected $owner;
  25.     /**
  26.      * Get order
  27.      *
  28.      * @return \XLite\Model\Order
  29.      */
  30.     public function getOrder()
  31.     {
  32.         return $this->getOwner()->getOrder();
  33.     }
  34.     /**
  35.      * Get id
  36.      *
  37.      * @return integer
  38.      */
  39.     public function getId()
  40.     {
  41.         return $this->id;
  42.     }
  43.     /**
  44.      * Set type
  45.      *
  46.      * @param string $type
  47.      * @return Surcharge
  48.      */
  49.     public function setType($type)
  50.     {
  51.         $this->type $type;
  52.         return $this;
  53.     }
  54.     /**
  55.      * Get type
  56.      *
  57.      * @return string
  58.      */
  59.     public function getType()
  60.     {
  61.         return $this->type;
  62.     }
  63.     /**
  64.      * Set code
  65.      *
  66.      * @param string $code
  67.      * @return Surcharge
  68.      */
  69.     public function setCode($code)
  70.     {
  71.         $this->code $code;
  72.         return $this;
  73.     }
  74.     /**
  75.      * Get code
  76.      *
  77.      * @return string
  78.      */
  79.     public function getCode()
  80.     {
  81.         return $this->code;
  82.     }
  83.     /**
  84.      * Set class
  85.      *
  86.      * @param string $class
  87.      * @return Surcharge
  88.      */
  89.     public function setClass($class)
  90.     {
  91.         $this->class $class;
  92.         return $this;
  93.     }
  94.     /**
  95.      * Get class
  96.      *
  97.      * @return string
  98.      */
  99.     public function getClass()
  100.     {
  101.         return $this->class;
  102.     }
  103.     /**
  104.      * Set include
  105.      *
  106.      * @param boolean $include
  107.      * @return Surcharge
  108.      */
  109.     public function setInclude($include)
  110.     {
  111.         $this->include $include;
  112.         return $this;
  113.     }
  114.     /**
  115.      * Get include
  116.      *
  117.      * @return boolean
  118.      */
  119.     public function getInclude()
  120.     {
  121.         return $this->include;
  122.     }
  123.     /**
  124.      * Set available
  125.      *
  126.      * @param boolean $available
  127.      * @return Surcharge
  128.      */
  129.     public function setAvailable($available)
  130.     {
  131.         $this->available $available;
  132.         return $this;
  133.     }
  134.     /**
  135.      * Get available
  136.      *
  137.      * @return boolean
  138.      */
  139.     public function getAvailable()
  140.     {
  141.         return $this->available;
  142.     }
  143.     /**
  144.      * Get value
  145.      *
  146.      * @return float
  147.      */
  148.     public function getValue()
  149.     {
  150.         return $this->value;
  151.     }
  152.     /**
  153.      * Set name
  154.      *
  155.      * @param string $name
  156.      * @return Surcharge
  157.      */
  158.     public function setName($name)
  159.     {
  160.         $this->name $name;
  161.         return $this;
  162.     }
  163.     /**
  164.      * Set weight
  165.      *
  166.      * @param integer $weight
  167.      * @return Surcharge
  168.      */
  169.     public function setWeight($weight)
  170.     {
  171.         $this->weight $weight;
  172.         return $this;
  173.     }
  174.     /**
  175.      * Get weight
  176.      *
  177.      * @return integer
  178.      */
  179.     public function getWeight()
  180.     {
  181.         return $this->weight;
  182.     }
  183.     /**
  184.      * Get owner
  185.      *
  186.      * @return \XLite\Model\OrderItem
  187.      */
  188.     public function getOwner()
  189.     {
  190.         return $this->owner;
  191.     }
  192. }