100 lines
1.7 KiB
PHP
100 lines
1.7 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;
|
|
|
|
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;
|
|
}
|
|
}
|