<?php
// vim: set ts=4 sw=4 sts=4 et:
/**
* X-Cart
*
* NOTICE OF LICENSE
*
* This source file is subject to the software license agreement
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.litecommerce.com/module-eula.html
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to redsqui@gmail.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not modify this file if you wish to upgrade X-Cart to newer versions
* in the future. If you wish to customize X-Cart for your needs please
* refer to http://www.x-cart.com/ for more information.
*
*
* @category X-Cart Next
* @author Vladimir Serov <redsqui@gmail.com>
* @copyright Copyright (c) 2012-present Vladimir Serov <redsqui@gmail.com>. All rights reserved
* @license http://www.litecommerce.com/module-eula.html LiteCommerce Module License Agreement
*/
namespace RedSqui\GiftCertificates\Model;
use Doctrine\ORM\Mapping as ORM;
/**
* Gift Certificates in orders
*
* @ORM\Entity (repositoryClass="\RedSqui\GiftCertificates\Model\Repo\UseGiftCard")
* @ORM\Table (name="gift_certificates_orders",
* indexes={
* @ORM\Index (name="order", columns={"order_id"}),
* @ORM\Index (name="card", columns={"card_id"})
* }
* )
*/
class UseGiftCard extends \XLite\Model\AEntity
{
/**
* id record
*
* @var integer
*
* @ORM\Id
* @ORM\GeneratedValue (strategy="AUTO")
* @ORM\Column (type="integer")
*/
protected $id = '';
/**
* Order
*
* @var \XLite\Model\Order
*
* @ORM\ManyToOne (targetEntity="XLite\Model\Order",cascade={"persist"})
* @ORM\JoinColumn (name="order_id", referencedColumnName="order_id", onDelete="CASCADE")
*/
protected $order;
/**
* Card code
*
* @var integer
*
* @ORM\ManyToOne (targetEntity="RedSqui\GiftCertificates\Model\GiftCerts")
* @ORM\JoinColumn (name="card_id", referencedColumnName="card_id")
*/
protected $card = '';
/**
* amount of payment by gift card
*
* @var float
*
* @ORM\Column (type="decimal", precision=14, scale=4)
*/
protected $value = 0.0000;
/**
* Name in panel.total
*
* @var string
*
* @ORM\Column (type="string")
*/
protected $name = '';
/**
* is used card
*
* @var boolean
*
* @ORM\Column (type="boolean", options={"default" = true})
*/
protected $used = true;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set value
*
* @param float $value
*
* @return UseGiftCard
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
/**
* Get value
*
* @return float
*/
public function getValue()
{
return $this->value;
}
/**
* Set name
*
* @param string $name
*
* @return UseGiftCard
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set used
*
* @param boolean $used
*
* @return UseGiftCard
*/
public function setUsed($used)
{
$this->used = $used;
return $this;
}
/**
* Get used
*
* @return boolean
*/
public function getUsed()
{
return $this->used;
}
/**
* Set order
*
* @param \XLite\Model\Order $order
*
* @return UseGiftCard
*/
public function setOrder(\XLite\Model\Order $order = null)
{
$this->order = $order;
return $this;
}
/**
* Get order
*
* @return \XLite\Model\Order
*/
public function getOrder()
{
return $this->order;
}
/**
* Set card
*
* @param \RedSqui\GiftCertificates\Model\GiftCerts $card
* @return UseGiftCard
*/
public function setCard(\RedSqui\GiftCertificates\Model\GiftCerts $card = null)
{
$this->card = $card;
return $this;
}
/**
* Get card
*
* @return \RedSqui\GiftCertificates\Model\GiftCerts
*/
public function getCard()
{
return $this->card;
}
}