<?php
namespace App\Entity;
use App\Entity\Room;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*
* @ORM\Table(name="delivery_rate")
*/
class Rate
{
/**
* @ORM\Id
*
* @ORM\GeneratedValue
*
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Room", cascade={"persist"})
*
* @ORM\JoinColumn(name="room_id", nullable=false, onDelete="cascade")
*/
private $room;
/**
* @ORM\ManyToOne(targetEntity="Location", cascade={"persist"})
*
* @ORM\JoinColumn(name="location_id", nullable=false, onDelete="cascade")
*/
private $location;
/**
* Price for category 1 vehicles.
*
* @ORM\Column(name="category_1_price", type="decimal", scale=2, nullable=true)
*/
private $category1Price;
/**
* Price for category 2 vehicles.
*
* @ORM\Column(name="category_2_price", type="decimal", scale=2, nullable=true)
*/
private $category2Price;
/**
* Price for non standard vehicles.
*
* @ORM\Column(name="non_standard_price", type="decimal", scale=2, nullable=true)
*/
private $nonStandardPrice;
public function getId()
{
return $this->id;
}
public function setCategory1Price($category1Price): void
{
$this->category1Price = $category1Price;
}
public function getCategory1Price()
{
return $this->category1Price;
}
public function setCategory2Price($category2Price): void
{
$this->category2Price = $category2Price;
}
public function getCategory2Price()
{
return $this->category2Price;
}
public function setNonStandardPrice($nonStandardPrice): void
{
$this->nonStandardPrice = $nonStandardPrice;
}
public function getNonStandardPrice()
{
return $this->nonStandardPrice;
}
public function setRoom(Room $room): void
{
$this->room = $room;
}
public function getRoom()
{
return $this->room;
}
public function setLocation(Location $location): void
{
$this->location = $location;
}
public function getLocation()
{
return $this->location;
}
public function hasPrices()
{
return 0 !== (int) $this->getCategory1Price()
|| 0 !== (int) $this->getCategory2Price()
|| 0 !== (int) $this->getNonStandardPrice();
}
public function hasFreeNonStandard()
{
return 0 == (int) $this->getNonStandardPrice();
}
}