<?php
namespace App\Entity\Quote;
use App\Entity\Common\FileResource;
use App\Repository\Quote\QuoteServiceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=QuoteServiceRepository::class)
* @ORM\Table(name="quote_service_quote")
*/
class QuoteService
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="float")
*/
private $price;
/**
* @ORM\ManyToOne(targetEntity=Quote::class, inversedBy="services")
* @ORM\JoinColumn(nullable=false)
*/
private $quote;
/**
* @ORM\ManyToOne(targetEntity=Service::class, inversedBy="quotes")
* @ORM\JoinColumn(nullable=false)
*/
private $service;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $observations;
/**
* @ORM\OneToMany(targetEntity=FileResource::class, mappedBy="quoteService")
*/
private $evidences;
/**
* @ORM\Column(type="float")
*/
private $defaultPrice;
public function __construct()
{
$this->evidences = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(float $price): self
{
$this->price = $price;
return $this;
}
public function getQuote(): ?Quote
{
return $this->quote;
}
public function setQuote(?Quote $quote): self
{
$this->quote = $quote;
return $this;
}
public function getService(): ?Service
{
return $this->service;
}
public function setService(?Service $service): self
{
$this->service = $service;
return $this;
}
public function getObservations(): ?string
{
return $this->observations;
}
public function setObservations(?string $observations): self
{
$this->observations = $observations;
return $this;
}
/**
* @return Collection<int, FileResource>
*/
public function getEvidences(): Collection
{
return $this->evidences;
}
public function addEvidence(FileResource $evidence): self
{
if (!$this->evidences->contains($evidence)) {
$this->evidences[] = $evidence;
$evidence->setQuoteService($this);
}
return $this;
}
public function removeEvidence(FileResource $evidence): self
{
if ($this->evidences->removeElement($evidence)) {
// set the owning side to null (unless already changed)
if ($evidence->getQuoteService() === $this) {
$evidence->setQuoteService(null);
}
}
return $this;
}
public function getDefaultPrice(): ?float
{
return $this->defaultPrice;
}
public function setDefaultPrice(float $defaultPrice): self
{
$this->defaultPrice = $defaultPrice;
return $this;
}
}