src/Entity/Acquisition.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\TimestampableTrait;
  4. use App\Repository\AcquisitionRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=AcquisitionRepository::class)
  10.  */
  11. class Acquisition
  12. {
  13.     use TimestampableTrait;
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=Transporteur::class, inversedBy="acquisitions")
  22.      */
  23.     private $transporteur;
  24.     /**
  25.      * @ORM\Column(type="datetime", nullable=true)
  26.      */
  27.     private $dateAchat;
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true)
  30.      */
  31.     private $status;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      */
  35.     private $funding;
  36.     /**
  37.      * @ORM\Column(type="string", length=255, nullable=true)
  38.      */
  39.     private $price;
  40.     /**
  41.      * @ORM\Column(type="string", length=255, nullable=true)
  42.      */
  43.     private $contribution;
  44.     /**
  45.      * @ORM\Column(type="string", length=255, nullable=true)
  46.      */
  47.     private $refund;
  48.     /**
  49.      * @ORM\Column(type="datetime", nullable=true)
  50.      */
  51.     private $endDate;
  52.     /**
  53.      * @ORM\Column(type="string", length=255, nullable=true)
  54.      */
  55.     private $currentPrice;
  56.     /**
  57.      * @ORM\Column(type="string", length=255, nullable=true)
  58.      */
  59.     private $vehicleStatus;
  60.     
  61.     /**
  62.      * @ORM\OneToMany(targetEntity=Attachment::class, mappedBy="acquisition", orphanRemoval=true, cascade={"persist", "remove"})
  63.      */
  64.     private $attachments;
  65.     /**
  66.      * @ORM\Column(type="text", nullable=true)
  67.      */
  68.     private $report;
  69.     /**
  70.      * @ORM\Column(type="string", length=255, nullable=true)
  71.      */
  72.     private $mileage;
  73.     /**
  74.      * @ORM\ManyToOne(targetEntity=Vehicle::class, inversedBy="acquisitions")
  75.      */
  76.     private $vehicle;
  77.     public function __construct()
  78.     {
  79.         $this->attachments = new ArrayCollection();
  80.     }
  81.     public function getId(): ?int
  82.     {
  83.         return $this->id;
  84.     }
  85.     public function getTransporteur(): ?Transporteur
  86.     {
  87.         return $this->transporteur;
  88.     }
  89.     public function setTransporteur(?Transporteur $transporteur): self
  90.     {
  91.         $this->transporteur $transporteur;
  92.         return $this;
  93.     }
  94.     public function getDateAchat(): ?\DateTimeInterface
  95.     {
  96.         return $this->dateAchat;
  97.     }
  98.     public function setDateAchat(?\DateTimeInterface $dateAchat): self
  99.     {
  100.         $this->dateAchat $dateAchat;
  101.         return $this;
  102.     }
  103.     public function getStatus(): ?string
  104.     {
  105.         return $this->status;
  106.     }
  107.     public function setStatus(?string $status): self
  108.     {
  109.         $this->status $status;
  110.         return $this;
  111.     }
  112.     public function getFunding(): ?string
  113.     {
  114.         return $this->funding;
  115.     }
  116.     public function setFunding(?string $funding): self
  117.     {
  118.         $this->funding $funding;
  119.         return $this;
  120.     }
  121.     public function getPrice(): ?string
  122.     {
  123.         return $this->price;
  124.     }
  125.     public function setPrice(?string $price): self
  126.     {
  127.         $this->price $price;
  128.         return $this;
  129.     }
  130.     public function getContribution(): ?string
  131.     {
  132.         return $this->contribution;
  133.     }
  134.     public function setContribution(?string $contribution): self
  135.     {
  136.         $this->contribution $contribution;
  137.         return $this;
  138.     }
  139.     public function getRefund(): ?string
  140.     {
  141.         return $this->refund;
  142.     }
  143.     public function setRefund(?string $refund): self
  144.     {
  145.         $this->refund $refund;
  146.         return $this;
  147.     }
  148.     public function getEndDate(): ?\DateTimeInterface
  149.     {
  150.         return $this->endDate;
  151.     }
  152.     public function setEndDate(?\DateTimeInterface $endDate): self
  153.     {
  154.         $this->endDate $endDate;
  155.         return $this;
  156.     }
  157.     public function getCurrentPrice(): ?string
  158.     {
  159.         return $this->currentPrice;
  160.     }
  161.     public function setCurrentPrice(?string $currentPrice): self
  162.     {
  163.         $this->currentPrice $currentPrice;
  164.         return $this;
  165.     }
  166.     public function getVehicleStatus(): ?string
  167.     {
  168.         return $this->vehicleStatus;
  169.     }
  170.     public function setVehicleStatus(?string $vehicleStatus): self
  171.     {
  172.         $this->vehicleStatus $vehicleStatus;
  173.         return $this;
  174.     }
  175.     /**
  176.      * @return Collection<int, Attachment>
  177.      */
  178.     public function getAttachments(): Collection
  179.     {
  180.         return $this->attachments;
  181.     }
  182.     public function addAttachment(Attachment $attachment): self
  183.     {
  184.         if (!$this->attachments->contains($attachment)) {
  185.             $this->attachments[] = $attachment;
  186.             $attachment->setAcquisition($this);
  187.         }
  188.         return $this;
  189.     }
  190.     public function removeAttachment(Attachment $attachment): self
  191.     {
  192.         if ($this->attachments->removeElement($attachment)) {
  193.             // set the owning side to null (unless already changed)
  194.             if ($attachment->getAcquisition() === $this) {
  195.                 $attachment->setAcquisition(null);
  196.             }
  197.         }
  198.         return $this;
  199.     }
  200.     public function getReport(): ?string
  201.     {
  202.         return $this->report;
  203.     }
  204.     public function setReport(?string $report): self
  205.     {
  206.         $this->report $report;
  207.         return $this;
  208.     }
  209.     public function getMileage(): ?string
  210.     {
  211.         return $this->mileage;
  212.     }
  213.     public function setMileage(?string $mileage): self
  214.     {
  215.         $this->mileage $mileage;
  216.         return $this;
  217.     }
  218.     public function getVehicle(): ?Vehicle
  219.     {
  220.         return $this->vehicle;
  221.     }
  222.     public function setVehicle(?Vehicle $vehicle): self
  223.     {
  224.         $this->vehicle $vehicle;
  225.         return $this;
  226.     }    
  227. }