<?php
namespace App\Entity;
use App\Repository\PurchaseHistoryRepository;
use App\Traits\DateTrait;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=PurchaseHistoryRepository::class)
*/
class PurchaseHistory
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Purchase::class, inversedBy="purchaseHistories")
* @ORM\JoinColumn(onDelete="SET NULL")
*/
private $purchase;
/**
* @ORM\Column(type="integer")
*/
private $value;
/**
* @ORM\Column(type="string", length=255)
*/
private $reason;
use DateTrait;
public function getId(): ?int
{
return $this->id;
}
public function getPurchase(): ?Purchase
{
return $this->purchase;
}
public function setPurchase( ?Purchase $purchase ): self
{
$this->purchase = $purchase;
return $this;
}
public function getValue(): ?int
{
return $this->value;
}
public function setValue( int $value ): self
{
$this->value = $value;
return $this;
}
public function getReason(): ?string
{
return $this->reason;
}
public function setReason( string $reason ): self
{
$this->reason = $reason;
return $this;
}
}