first commit
This commit is contained in:
193
bundles/KupShop/PricelistBundle/Entity/Pricelist.php
Normal file
193
bundles/KupShop/PricelistBundle/Entity/Pricelist.php
Normal file
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PricelistBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Class Pricelist.
|
||||
*
|
||||
* @ORM\Entity
|
||||
*
|
||||
* @ORM\Table(name="pricelists", options={"collate":"utf8"})
|
||||
*/
|
||||
class Pricelist
|
||||
{
|
||||
/**
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=60)
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", name="use_product_discount")
|
||||
*/
|
||||
private $useProductDiscount;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="float", name="coefficient")
|
||||
*/
|
||||
private $coefficient;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="KupShop\I18nBundle\Entity\Currency")
|
||||
*
|
||||
* @ORM\JoinColumn(name="currency")
|
||||
*/
|
||||
private $currency;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="KupShop\PricelistBundle\Entity\PricelistProduct", mappedBy="pricelist", cascade={"remove", "persist"})
|
||||
*/
|
||||
private $product;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->product = new \Doctrine\Common\Collections\ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set name.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return Pricelist
|
||||
*/
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get name.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set currency.
|
||||
*
|
||||
* @return Pricelist
|
||||
*/
|
||||
public function setCurrency(?\KupShop\I18nBundle\Entity\Currency $currency = null)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get currency.
|
||||
*
|
||||
* @return \KupShop\I18nBundle\Entity\Currency
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add product.
|
||||
*
|
||||
* @return Pricelist
|
||||
*/
|
||||
public function addProduct(PricelistProduct $product)
|
||||
{
|
||||
$this->product[] = $product;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove product.
|
||||
*/
|
||||
public function removeProduct(PricelistProduct $product)
|
||||
{
|
||||
$this->product->removeElement($product);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product.
|
||||
*
|
||||
* @return \Doctrine\Common\Collections\Collection
|
||||
*/
|
||||
public function getProduct()
|
||||
{
|
||||
return $this->product;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get extend product discount field.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getUseProductDiscount()
|
||||
{
|
||||
return $this->useProductDiscount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set use product discount field.
|
||||
*
|
||||
* @param bool $useProductDiscount
|
||||
*
|
||||
* @return Pricelist
|
||||
*/
|
||||
public function setUseProductDiscount($useProductDiscount)
|
||||
{
|
||||
$this->useProductDiscount = $useProductDiscount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get coefficient field.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getCoefficient()
|
||||
{
|
||||
return $this->coefficient;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set use product discount field.
|
||||
*
|
||||
* @param float $coefficient
|
||||
*
|
||||
* @return Pricelist
|
||||
*/
|
||||
public function setCoefficient($coefficient)
|
||||
{
|
||||
$this->coefficient = $coefficient;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user