src/Entity/Quote/QuoteService.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Quote;
  3. use App\Entity\Common\FileResource;
  4. use App\Repository\Quote\QuoteServiceRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=QuoteServiceRepository::class)
  10.  * @ORM\Table(name="quote_service_quote")
  11.  */
  12. class QuoteService
  13. {
  14.     /**
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="float")
  22.      */
  23.     private $price;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=Quote::class, inversedBy="services")
  26.      * @ORM\JoinColumn(nullable=false)
  27.      */
  28.     private $quote;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=Service::class, inversedBy="quotes")
  31.      * @ORM\JoinColumn(nullable=false)
  32.      */
  33.     private $service;
  34.     /**
  35.      * @ORM\Column(type="text", nullable=true)
  36.      */
  37.     private $observations;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity=FileResource::class, mappedBy="quoteService")
  40.      */
  41.     private $evidences;
  42.     /**
  43.      * @ORM\Column(type="float")
  44.      */
  45.     private $defaultPrice;
  46.     public function __construct()
  47.     {
  48.         $this->evidences = new ArrayCollection();
  49.     }
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.     public function getPrice(): ?float
  55.     {
  56.         return $this->price;
  57.     }
  58.     public function setPrice(float $price): self
  59.     {
  60.         $this->price $price;
  61.         return $this;
  62.     }
  63.     public function getQuote(): ?Quote
  64.     {
  65.         return $this->quote;
  66.     }
  67.     public function setQuote(?Quote $quote): self
  68.     {
  69.         $this->quote $quote;
  70.         return $this;
  71.     }
  72.     public function getService(): ?Service
  73.     {
  74.         return $this->service;
  75.     }
  76.     public function setService(?Service $service): self
  77.     {
  78.         $this->service $service;
  79.         return $this;
  80.     }
  81.     public function getObservations(): ?string
  82.     {
  83.         return $this->observations;
  84.     }
  85.     public function setObservations(?string $observations): self
  86.     {
  87.         $this->observations $observations;
  88.         return $this;
  89.     }
  90.     /**
  91.      * @return Collection<int, FileResource>
  92.      */
  93.     public function getEvidences(): Collection
  94.     {
  95.         return $this->evidences;
  96.     }
  97.     public function addEvidence(FileResource $evidence): self
  98.     {
  99.         if (!$this->evidences->contains($evidence)) {
  100.             $this->evidences[] = $evidence;
  101.             $evidence->setQuoteService($this);
  102.         }
  103.         return $this;
  104.     }
  105.     public function removeEvidence(FileResource $evidence): self
  106.     {
  107.         if ($this->evidences->removeElement($evidence)) {
  108.             // set the owning side to null (unless already changed)
  109.             if ($evidence->getQuoteService() === $this) {
  110.                 $evidence->setQuoteService(null);
  111.             }
  112.         }
  113.         return $this;
  114.     }
  115.     public function getDefaultPrice(): ?float
  116.     {
  117.         return $this->defaultPrice;
  118.     }
  119.     public function setDefaultPrice(float $defaultPrice): self
  120.     {
  121.         $this->defaultPrice $defaultPrice;
  122.         return $this;
  123.     }
  124. }