<?php
namespace App\Entity\Quote;
use App\Repository\Quote\ServiceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ServiceRepository::class)
* @ORM\Table(name="quote_service")
*/
class Service
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=1024)
*/
private $name;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="boolean")
*/
private $isDefault;
/**
* @ORM\Column(type="float", nullable=true)
*/
private $defaultPrice;
/**
* @ORM\OneToMany(targetEntity=QuoteService::class, mappedBy="service")
*/
private $quotes;
/**
* @ORM\Column(type="boolean")
*/
private $enabled;
public function __construct()
{
$this->quotes = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function isIsDefault(): ?bool
{
return $this->isDefault;
}
public function setIsDefault(bool $isDefault): self
{
$this->isDefault = $isDefault;
return $this;
}
public function getDefaultPrice(): ?float
{
return $this->defaultPrice;
}
public function setDefaultPrice(?float $defaultPrice): self
{
$this->defaultPrice = $defaultPrice;
return $this;
}
/**
* @return Collection<int, QuoteService>
*/
public function getQuotes(): Collection
{
return $this->quotes;
}
public function addQuote(QuoteService $quote): self
{
if (!$this->quotes->contains($quote)) {
$this->quotes[] = $quote;
$quote->setService($this);
}
return $this;
}
public function removeQuote(QuoteService $quote): self
{
if ($this->quotes->removeElement($quote)) {
// set the owning side to null (unless already changed)
if ($quote->getService() === $this) {
$quote->setService(null);
}
}
return $this;
}
public function isEnabled(): ?bool
{
return $this->enabled;
}
public function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
}