<?php
namespace App\Entity;
use App\Entity\TimestampableTrait;
use App\Repository\AcquisitionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AcquisitionRepository::class)
*/
class Acquisition
{
use TimestampableTrait;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Transporteur::class, inversedBy="acquisitions")
*/
private $transporteur;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $dateAchat;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $status;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $funding;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $price;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $contribution;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $refund;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $endDate;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $currentPrice;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $vehicleStatus;
/**
* @ORM\OneToMany(targetEntity=Attachment::class, mappedBy="acquisition", orphanRemoval=true, cascade={"persist", "remove"})
*/
private $attachments;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $report;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $mileage;
/**
* @ORM\ManyToOne(targetEntity=Vehicle::class, inversedBy="acquisitions")
*/
private $vehicle;
public function __construct()
{
$this->attachments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTransporteur(): ?Transporteur
{
return $this->transporteur;
}
public function setTransporteur(?Transporteur $transporteur): self
{
$this->transporteur = $transporteur;
return $this;
}
public function getDateAchat(): ?\DateTimeInterface
{
return $this->dateAchat;
}
public function setDateAchat(?\DateTimeInterface $dateAchat): self
{
$this->dateAchat = $dateAchat;
return $this;
}
public function getStatus(): ?string
{
return $this->status;
}
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
public function getFunding(): ?string
{
return $this->funding;
}
public function setFunding(?string $funding): self
{
$this->funding = $funding;
return $this;
}
public function getPrice(): ?string
{
return $this->price;
}
public function setPrice(?string $price): self
{
$this->price = $price;
return $this;
}
public function getContribution(): ?string
{
return $this->contribution;
}
public function setContribution(?string $contribution): self
{
$this->contribution = $contribution;
return $this;
}
public function getRefund(): ?string
{
return $this->refund;
}
public function setRefund(?string $refund): self
{
$this->refund = $refund;
return $this;
}
public function getEndDate(): ?\DateTimeInterface
{
return $this->endDate;
}
public function setEndDate(?\DateTimeInterface $endDate): self
{
$this->endDate = $endDate;
return $this;
}
public function getCurrentPrice(): ?string
{
return $this->currentPrice;
}
public function setCurrentPrice(?string $currentPrice): self
{
$this->currentPrice = $currentPrice;
return $this;
}
public function getVehicleStatus(): ?string
{
return $this->vehicleStatus;
}
public function setVehicleStatus(?string $vehicleStatus): self
{
$this->vehicleStatus = $vehicleStatus;
return $this;
}
/**
* @return Collection<int, Attachment>
*/
public function getAttachments(): Collection
{
return $this->attachments;
}
public function addAttachment(Attachment $attachment): self
{
if (!$this->attachments->contains($attachment)) {
$this->attachments[] = $attachment;
$attachment->setAcquisition($this);
}
return $this;
}
public function removeAttachment(Attachment $attachment): self
{
if ($this->attachments->removeElement($attachment)) {
// set the owning side to null (unless already changed)
if ($attachment->getAcquisition() === $this) {
$attachment->setAcquisition(null);
}
}
return $this;
}
public function getReport(): ?string
{
return $this->report;
}
public function setReport(?string $report): self
{
$this->report = $report;
return $this;
}
public function getMileage(): ?string
{
return $this->mileage;
}
public function setMileage(?string $mileage): self
{
$this->mileage = $mileage;
return $this;
}
public function getVehicle(): ?Vehicle
{
return $this->vehicle;
}
public function setVehicle(?Vehicle $vehicle): self
{
$this->vehicle = $vehicle;
return $this;
}
}