<?php
namespace App\Entity;
use App\Entity\Base\AbstractTimestampableEntity;
use App\Repository\OfferRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=OfferRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class Offer extends AbstractTimestampableEntity
{
/**
* @ORM\ManyToOne(targetEntity=Project::class, inversedBy="offers")
* @ORM\JoinColumn(nullable=false)
*/
private Project $project;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="string", length=500, nullable=true)
*/
private $subtitle;
/**
* @ORM\Column(type="date")
*/
private $offerDate;
/**
* @ORM\Column(type="date")
*/
private $deadlineDate;
/**
* @ORM\Column(type="decimal", precision=11, scale=2, nullable=true)
*/
private $total;
/**
* @ORM\OneToMany(targetEntity=OfferBody::class, mappedBy="offer")
*/
private $offerBodies;
/**
* @ORM\ManyToOne(targetEntity=Currency::class, inversedBy="offers")
* @ORM\JoinColumn(nullable=false)
*/
private $currency;
/**
* @ORM\ManyToOne(targetEntity=OfferStatus::class, inversedBy="offers")
* @ORM\JoinColumn(nullable=false)
*/
private $status;
/**
* @ORM\Column(type="decimal", precision=11, scale=2, nullable=true)
*/
private $hourlyRate;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $estimateDurationDay;
/**
* @ORM\ManyToOne(targetEntity=Language::class, inversedBy="offers")
* @ORM\JoinColumn(nullable=false)
*/
private $language;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $estimatedHour;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $Comment;
/**
* @ORM\Column(type="boolean",options={"default":false})
*/
private bool $pricePerTask=false;
/**
* @ORM\Column(type="boolean",options={"default":false})
*/
private bool $timePerTask=false;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $shortDescription;
public function __construct()
{
$this->offerBodies = new ArrayCollection();
}
public function getProject(): ?Project
{
return $this->project;
}
public function setProject(?Project $project): self
{
$this->project = $project;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(?string $subtitle): self
{
$this->subtitle = $subtitle;
return $this;
}
public function getOfferDate(): ?\DateTimeInterface
{
return $this->offerDate;
}
public function setOfferDate(\DateTimeInterface $offerDate): self
{
$this->offerDate = $offerDate;
return $this;
}
public function getDeadlineDate(): ?\DateTimeInterface
{
return $this->deadlineDate;
}
public function setDeadlineDate(\DateTimeInterface $deadlineDate): self
{
$this->deadlineDate = $deadlineDate;
return $this;
}
public function getTotal(): ?string
{
return $this->total;
}
public function setTotal(string $total): self
{
$this->total = $total;
return $this;
}
/**
* @return Collection<int, OfferBody>
*/
public function getOfferBodies(): Collection
{
return $this->offerBodies;
}
public function addOfferBody(OfferBody $offerBody): self
{
if (!$this->offerBodies->contains($offerBody)) {
$this->offerBodies[] = $offerBody;
$offerBody->setOffer($this);
}
return $this;
}
public function removeOfferBody(OfferBody $offerBody): self
{
if ($this->offerBodies->removeElement($offerBody)) {
// set the owning side to null (unless already changed)
if ($offerBody->getOffer() === $this) {
$offerBody->setOffer(null);
}
}
return $this;
}
public function getCurrency(): ?Currency
{
return $this->currency;
}
public function setCurrency(?Currency $currency): self
{
$this->currency = $currency;
return $this;
}
public function getStatus(): ?OfferStatus
{
return $this->status;
}
public function setStatus(?OfferStatus $status): self
{
$this->status = $status;
return $this;
}
public function getHourlyRate(): ?string
{
return $this->hourlyRate;
}
public function setHourlyRate(?string $hourlyRate): self
{
$this->hourlyRate = $hourlyRate;
return $this;
}
public function getEstimateDurationDay(): ?int
{
return $this->estimateDurationDay;
}
public function setEstimateDurationDay(?int $estimateDurationDay): self
{
$this->estimateDurationDay = $estimateDurationDay;
return $this;
}
public function getLanguage(): ?Language
{
return $this->language;
}
public function setLanguage(?Language $language): self
{
$this->language = $language;
return $this;
}
public function getEstimatedHour(): ?int
{
return $this->estimatedHour;
}
public function setEstimatedHour(?int $estimatedHour): self
{
$this->estimatedHour = $estimatedHour;
return $this;
}
public function getComment(): ?string
{
return $this->Comment;
}
public function setComment(?string $Comment): self
{
$this->Comment = $Comment;
return $this;
}
public function isPricePerTask(): bool
{
return $this->pricePerTask;
}
public function setPricePerTask(bool $pricePerTask): self
{
$this->pricePerTask = $pricePerTask;
return $this;
}
public function isTimePerTask(): bool
{
return $this->timePerTask;
}
public function setTimePerTask(bool $timePerTask): self
{
$this->timePerTask = $timePerTask;
return $this;
}
public function getShortDescription(): ?string
{
return $this->shortDescription;
}
public function setShortDescription(?string $shortDescription): self
{
$this->shortDescription = $shortDescription;
return $this;
}
}