src/Entity/PurchaseTracking/GaragePurchase.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\PurchaseTracking;
  3. use App\Annotation\SiteAware;
  4. use App\Entity\AbstractBase;
  5. use App\Entity\Garages\Garage;
  6. use App\Entity\Interfaces\SiteInterface;
  7. use App\Entity\OnlineShop\Supplier;
  8. use App\Entity\Traits\SiteTrait;
  9. use App\Repository\PurchaseTracking\GaragePurchaseRepository;
  10. use DateTimeInterface;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Gedmo\Mapping\Annotation as Gedmo;
  13. /**
  14.  * @ORM\Table(name="vulco_garage_purchase", indexes={@ORM\Index(name="garage_purchase_site_idx", columns={"site"})}, uniqueConstraints={@ORM\UniqueConstraint(name="garage_and_supplier_and_year_purchases_unique_idx", columns={"garage_id", "supplier_id", "year"})})
  15.  * @ORM\Entity(repositoryClass=GaragePurchaseRepository::class)
  16.  * @Gedmo\SoftDeleteable(fieldName="removedAt", timeAware=false)
  17.  * @SiteAware(siteFieldName="site")
  18.  */
  19. class GaragePurchase extends AbstractBase implements SiteInterface
  20. {
  21.     use SiteTrait;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity="App\Entity\Garages\Garage", inversedBy="purchases")
  24.      * @ORM\JoinColumn(name="garage_id", referencedColumnName="id")
  25.      */
  26.     private Garage $garage;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity="App\Entity\OnlineShop\Supplier", fetch="EAGER")
  29.      * @ORM\JoinColumn(name="supplier_id", referencedColumnName="id", onDelete="CASCADE")
  30.      */
  31.     private Supplier $supplier;
  32.     /**
  33.      * @ORM\Column(type="integer")
  34.      */
  35.     private $year;
  36.     /**
  37.      * @ORM\Column(type="datetime", nullable=true)
  38.      */
  39.     protected ?DateTimeInterface $date;
  40.     /**
  41.      * @ORM\Column(type="float")
  42.      */
  43.     private $amount;
  44.     /**
  45.      * @ORM\Column(type="float")
  46.      */
  47.     private $rappelPercentage;
  48.     /**
  49.      * @ORM\Column(type="float")
  50.      */
  51.     private $rappelAmount;
  52.     public function getGarage(): Garage
  53.     {
  54.         return $this->garage;
  55.     }
  56.     public function setGarage(Garage $garage): self
  57.     {
  58.         $this->garage $garage;
  59.         return $this;
  60.     }
  61.     public function getSupplier(): Supplier
  62.     {
  63.         return $this->supplier;
  64.     }
  65.     public function setSupplier(Supplier $supplier): self
  66.     {
  67.         $this->supplier $supplier;
  68.         return $this;
  69.     }
  70.     public function getYear(): int
  71.     {
  72.         return $this->year;
  73.     }
  74.     public function setYear(int $year): self
  75.     {
  76.         $this->year $year;
  77.         return $this;
  78.     }
  79.     public function getDate(): ?DateTimeInterface
  80.     {
  81.         return $this->date;
  82.     }
  83.     public function setDate(?DateTimeInterface $date): self
  84.     {
  85.         $this->date $date;
  86.         return $this;
  87.     }
  88.     public function getAmount(): float
  89.     {
  90.         return $this->amount;
  91.     }
  92.     public function setAmount(float $amount): self
  93.     {
  94.         $this->amount $amount;
  95.         return $this;
  96.     }
  97.     public function getRappelPercentage(): float
  98.     {
  99.         return $this->rappelPercentage;
  100.     }
  101.     public function setRappelPercentage(float $rappelPercentage): self
  102.     {
  103.         $this->rappelPercentage $rappelPercentage;
  104.         return $this;
  105.     }
  106.     public function getRappelAmount(): float
  107.     {
  108.         return $this->rappelAmount;
  109.     }
  110.     public function setRappelAmount(float $rappelAmount): self
  111.     {
  112.         $this->rappelAmount $rappelAmount;
  113.         return $this;
  114.     }
  115. }