<?php
namespace App\Entity\Price;
use App\Entity\GeneralConfig;
use App\Repository\Price\RangeRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=RangeRepository::class)
* @ORM\Table(name="price_range")
*/
class Range
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="float")
*/
private $minKG;
/**
* @ORM\Column(type="float")
*/
private $maxKG;
/**
* @ORM\Column(type="float")
*/
private $price;
/**
* @ORM\ManyToOne(targetEntity=GeneralConfig::class, inversedBy="ranges")
* @ORM\JoinColumn(nullable=false)
*/
private $config;
public function getId(): ?int
{
return $this->id;
}
public function getMinKG(): ?float
{
return $this->minKG;
}
public function setMinKG(float $minKG): self
{
$this->minKG = $minKG;
return $this;
}
public function getMaxKG(): ?float
{
return $this->maxKG;
}
public function setMaxKG(float $maxKG): self
{
$this->maxKG = $maxKG;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(float $price): self
{
$this->price = $price;
return $this;
}
public function getConfig(): ?GeneralConfig
{
return $this->config;
}
public function setConfig(?GeneralConfig $config): self
{
$this->config = $config;
return $this;
}
public function __toString()
{
return $this->minKG . 'KG - ' . $this->maxKG . 'KG -> ' . $this->price . '$';
}
}