Files
2025-08-02 16:30:27 +02:00

270 lines
4.7 KiB
PHP

<?php
namespace KupShop\DeliveryPriceListBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*
* @ORM\Table(name="delivery_pricelists")
*/
class PriceList
{
/**
* @ORM\Id
*
* @ORM\Column(type="integer")
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\OneToMany(targetEntity="Price", mappedBy="priceList", cascade={"remove", "persist"})
*/
private $prices;
/**
* @ORM\OneToMany(targetEntity="Region", mappedBy="priceList", cascade={"remove", "persist"})
*/
private $regions;
/**
* @ORM\OneToMany(targetEntity="RegionCountry", mappedBy="pricelist", cascade={"remove", "persist"})
*/
private $regionCountry;
/**
* @ORM\OneToMany(targetEntity="WeightGroup", mappedBy="priceList", cascade={"remove", "persist"})
*/
private $weightGroups;
/**
* @ORM\Column(type="string", length=60)
*/
private $name;
/**
* @ORM\ManyToOne(targetEntity="KupShop\I18nBundle\Entity\Currency")
*
* @ORM\JoinColumn(name="id_currency")
*/
private $currency;
/**
* @ORM\Column(name="on_max_weight", type="string", columnDefinition="ENUM('divide', 'forbid')")
*/
private $onMaxWeight;
/**
* 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.
*
* @param string $currency
*
* @return PriceList
*/
public function setCurrency($currency)
{
$this->currency = $currency;
return $this;
}
/**
* Get currency.
*
* @return int
*/
public function getCurrency()
{
return $this->currency;
}
/**
* Set onMaxWeight.
*
* @param string $onMaxWeight
*
* @return PriceList
*/
public function setOnMaxWeight($onMaxWeight)
{
$this->onMaxWeight = $onMaxWeight;
return $this;
}
/**
* Get onMaxWeight.
*
* @return string
*/
public function getOnMaxWeight()
{
return $this->onMaxWeight;
}
/**
* Constructor.
*/
public function __construct()
{
$this->prices = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add price.
*
* @return PriceList
*/
public function addPrice(Price $price)
{
$this->prices[] = $price;
return $this;
}
/**
* Remove price.
*/
public function removePrice(Price $price)
{
$this->prices->removeElement($price);
}
/**
* Get prices.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPrices()
{
return $this->prices;
}
/**
* Add region.
*
* @return PriceList
*/
public function addRegion(Region $region)
{
$this->regions[] = $region;
return $this;
}
/**
* Remove region.
*/
public function removeRegion(Region $region)
{
$this->regions->removeElement($region);
}
/**
* Get regions.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getRegions()
{
return $this->regions;
}
/**
* Add weightGroup.
*
* @return PriceList
*/
public function addWeightGroup(WeightGroup $weightGroup)
{
$this->weightGroups[] = $weightGroup;
return $this;
}
/**
* Remove weightGroup.
*/
public function removeWeightGroup(WeightGroup $weightGroup)
{
$this->weightGroups->removeElement($weightGroup);
}
/**
* Get weightGroups.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getWeightGroups()
{
return $this->weightGroups;
}
/**
* Add regionCountry.
*
* @return PriceList
*/
public function addRegionCountry(RegionCountry $regionCountry)
{
$this->regionCountry[] = $regionCountry;
return $this;
}
/**
* Remove regionCountry.
*/
public function removeRegionCountry(RegionCountry $regionCountry)
{
$this->regionCountry->removeElement($regionCountry);
}
/**
* Get regionCountry.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getRegionCountry()
{
return $this->regionCountry;
}
}