97 lines
1.9 KiB
PHP
97 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* @ORM\Entity
|
|
* @ORM\Table(name="item")
|
|
*/
|
|
|
|
class ItemPrice
|
|
{
|
|
// unique id
|
|
/**
|
|
* @ORM\Id
|
|
* @ORM\Column(type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
*/
|
|
protected $id;
|
|
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="PriceTier", inversedBy="item_prices")
|
|
* @ORM\JoinColumn(name="price_tier_id", referencedColumnName="id")
|
|
*/
|
|
protected $price_tier;
|
|
|
|
// item type
|
|
/**
|
|
* @ORM\ManyToOne(targetEntity="ItemType", inversedBy="items")
|
|
* @ORM\JoinColumn(name="item_type_id", referencedColumnName="id")
|
|
*/
|
|
protected $item_type;
|
|
|
|
// could be battery id or service offering id, loosely coupled
|
|
/**
|
|
* @ORM\Column(type="integer")
|
|
*/
|
|
protected $item_id;
|
|
|
|
// current price
|
|
// NOTE: we need to move the decimal point two places to the left to get actual value
|
|
// we want to avoid floating point problems
|
|
/**
|
|
* @ORM\Column(type="integer")
|
|
*/
|
|
protected $price;
|
|
|
|
public function getID()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function setPriceTier(PriceTier $price_tier)
|
|
{
|
|
$this->price_tier = $price_tier;
|
|
return $this;
|
|
}
|
|
|
|
public function getPriceTier()
|
|
{
|
|
return $this->price_tier;
|
|
}
|
|
|
|
public function setItemType(ItemType $item_type)
|
|
{
|
|
$this->item_type = $item_type;
|
|
return $this;
|
|
}
|
|
|
|
public function getItemType()
|
|
{
|
|
return $this->item_type;
|
|
}
|
|
|
|
public function setItemID($item_id)
|
|
{
|
|
$this->item_id = $item_id;
|
|
return $this;
|
|
}
|
|
|
|
public function getItemID()
|
|
{
|
|
return $this->item_id;
|
|
}
|
|
|
|
public function setPrice($price)
|
|
{
|
|
$this->price = $price;
|
|
return $this;
|
|
}
|
|
|
|
public function getPrice()
|
|
{
|
|
return $this->price;
|
|
}
|
|
}
|