resq/src/Entity/InvoiceItem.php

118 lines
2.1 KiB
PHP

<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="invoice_item")
*/
class InvoiceItem
{
// unique id
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
// invoice the item is linked to
/**
* @ORM\ManyToOne(targetEntity="Invoice", inversedBy="items")
* @ORM\JoinColumn(name="invoice_id", referencedColumnName="id")
*/
protected $invoice;
// title of item
/**
* @ORM\Column(type="string", length=80)
*/
protected $title;
// quantity
/**
* @ORM\Column(type="smallint")
*/
protected $qty;
// price of item, negative for discounts
/**
* @ORM\Column(type="decimal", precision=9, scale=2)
*/
protected $price;
// battery the item is linked to
/**
* @ORM\ManyToOne(targetEntity="Battery")
* @ORM\JoinColumn(name="battery_id", referencedColumnName="id")
*/
protected $battery;
public function __construct()
{
$this->title = '';
$this->price = 0.0;
}
public function getID()
{
return $this->id;
}
public function setInvoice(Invoice $invoice)
{
$this->invoice = $invoice;
return $this;
}
public function getInvoice()
{
return $this->invoice;
}
public function setTitle($title)
{
$this->title = $title;
return $this;
}
public function getTitle()
{
return $this->title;
}
public function setQuantity($qty)
{
$this->qty = $qty;
return $this;
}
public function getQuantity()
{
return $this->qty;
}
public function setPrice($price)
{
$this->price = $price;
return $this;
}
public function getPrice()
{
return $this->price;
}
public function setBattery(Battery $battery)
{
$this->battery = $battery;
return $this;
}
public function getBattery()
{
return $this->battery;
}
}