src/Entity/Offer.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Base\AbstractTimestampableEntity;
  4. use App\Repository\OfferRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Entity(repositoryClass=OfferRepository::class)
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class Offer extends AbstractTimestampableEntity
  13. {
  14.     /**
  15.      * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="offers")
  16.      * @ORM\JoinColumn(nullable=false)
  17.      */
  18.     private Project $project;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $title;
  23.     /**
  24.      * @ORM\Column(type="string", length=500, nullable=true)
  25.      */
  26.     private $subtitle;
  27.     /**
  28.      * @ORM\Column(type="date")
  29.      */
  30.     private $offerDate;
  31.     /**
  32.      * @ORM\Column(type="date")
  33.      */
  34.     private $deadlineDate;
  35.     /**
  36.      * @ORM\Column(type="decimal", precision=11, scale=2, nullable=true)
  37.      */
  38.     private $total;
  39.     /**
  40.      * @ORM\OneToMany(targetEntity=OfferBody::class, mappedBy="offer")
  41.      */
  42.     private $offerBodies;
  43.     /**
  44.      * @ORM\ManyToOne(targetEntity=Currency::class, inversedBy="offers")
  45.      * @ORM\JoinColumn(nullable=false)
  46.      */
  47.     private $currency;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity=OfferStatus::class, inversedBy="offers")
  50.      * @ORM\JoinColumn(nullable=false)
  51.      */
  52.     private $status;
  53.     /**
  54.      * @ORM\Column(type="decimal", precision=11, scale=2, nullable=true)
  55.      */
  56.     private $hourlyRate;
  57.     /**
  58.      * @ORM\Column(type="integer", nullable=true)
  59.      */
  60.     private $estimateDurationDay;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity=Language::class, inversedBy="offers")
  63.      * @ORM\JoinColumn(nullable=false)
  64.      */
  65.     private $language;
  66.     /**
  67.      * @ORM\Column(type="integer", nullable=true)
  68.      */
  69.     private $estimatedHour;
  70.     /**
  71.      * @ORM\Column(type="text", nullable=true)
  72.      */
  73.     private $Comment;
  74.     /**
  75.      * @ORM\Column(type="boolean",options={"default":false})
  76.      */
  77.     private bool $pricePerTask=false;
  78.     /**
  79.      * @ORM\Column(type="boolean",options={"default":false})
  80.      */
  81.     private bool $timePerTask=false;
  82.     /**
  83.      * @ORM\Column(type="text", nullable=true)
  84.      */
  85.     private $shortDescription;
  86.     public function __construct()
  87.     {
  88.         $this->offerBodies = new ArrayCollection();
  89.     }
  90.     public function getProject(): ?Project
  91.     {
  92.         return $this->project;
  93.     }
  94.     public function setProject(?Project $project): self
  95.     {
  96.         $this->project $project;
  97.         return $this;
  98.     }
  99.     public function getTitle(): ?string
  100.     {
  101.         return $this->title;
  102.     }
  103.     public function setTitle(string $title): self
  104.     {
  105.         $this->title $title;
  106.         return $this;
  107.     }
  108.     public function getSubtitle(): ?string
  109.     {
  110.         return $this->subtitle;
  111.     }
  112.     public function setSubtitle(?string $subtitle): self
  113.     {
  114.         $this->subtitle $subtitle;
  115.         return $this;
  116.     }
  117.     public function getOfferDate(): ?\DateTimeInterface
  118.     {
  119.         return $this->offerDate;
  120.     }
  121.     public function setOfferDate(\DateTimeInterface $offerDate): self
  122.     {
  123.         $this->offerDate $offerDate;
  124.         return $this;
  125.     }
  126.     public function getDeadlineDate(): ?\DateTimeInterface
  127.     {
  128.         return $this->deadlineDate;
  129.     }
  130.     public function setDeadlineDate(\DateTimeInterface $deadlineDate): self
  131.     {
  132.         $this->deadlineDate $deadlineDate;
  133.         return $this;
  134.     }
  135.     public function getTotal(): ?string
  136.     {
  137.         return $this->total;
  138.     }
  139.     public function setTotal(string $total): self
  140.     {
  141.         $this->total $total;
  142.         return $this;
  143.     }
  144.     /**
  145.      * @return Collection<int, OfferBody>
  146.      */
  147.     public function getOfferBodies(): Collection
  148.     {
  149.         return $this->offerBodies;
  150.     }
  151.     public function addOfferBody(OfferBody $offerBody): self
  152.     {
  153.         if (!$this->offerBodies->contains($offerBody)) {
  154.             $this->offerBodies[] = $offerBody;
  155.             $offerBody->setOffer($this);
  156.         }
  157.         return $this;
  158.     }
  159.     public function removeOfferBody(OfferBody $offerBody): self
  160.     {
  161.         if ($this->offerBodies->removeElement($offerBody)) {
  162.             // set the owning side to null (unless already changed)
  163.             if ($offerBody->getOffer() === $this) {
  164.                 $offerBody->setOffer(null);
  165.             }
  166.         }
  167.         return $this;
  168.     }
  169.     public function getCurrency(): ?Currency
  170.     {
  171.         return $this->currency;
  172.     }
  173.     public function setCurrency(?Currency $currency): self
  174.     {
  175.         $this->currency $currency;
  176.         return $this;
  177.     }
  178.     public function getStatus(): ?OfferStatus
  179.     {
  180.         return $this->status;
  181.     }
  182.     public function setStatus(?OfferStatus $status): self
  183.     {
  184.         $this->status $status;
  185.         return $this;
  186.     }
  187.     public function getHourlyRate(): ?string
  188.     {
  189.         return $this->hourlyRate;
  190.     }
  191.     public function setHourlyRate(?string $hourlyRate): self
  192.     {
  193.         $this->hourlyRate $hourlyRate;
  194.         return $this;
  195.     }
  196.     public function getEstimateDurationDay(): ?int
  197.     {
  198.         return $this->estimateDurationDay;
  199.     }
  200.     public function setEstimateDurationDay(?int $estimateDurationDay): self
  201.     {
  202.         $this->estimateDurationDay $estimateDurationDay;
  203.         return $this;
  204.     }
  205.     public function getLanguage(): ?Language
  206.     {
  207.         return $this->language;
  208.     }
  209.     public function setLanguage(?Language $language): self
  210.     {
  211.         $this->language $language;
  212.         return $this;
  213.     }
  214.     public function getEstimatedHour(): ?int
  215.     {
  216.         return $this->estimatedHour;
  217.     }
  218.     public function setEstimatedHour(?int $estimatedHour): self
  219.     {
  220.         $this->estimatedHour $estimatedHour;
  221.         return $this;
  222.     }
  223.     public function getComment(): ?string
  224.     {
  225.         return $this->Comment;
  226.     }
  227.     public function setComment(?string $Comment): self
  228.     {
  229.         $this->Comment $Comment;
  230.         return $this;
  231.     }
  232.     public function isPricePerTask(): bool
  233.     {
  234.         return $this->pricePerTask;
  235.     }
  236.     public function setPricePerTask(bool $pricePerTask): self
  237.     {
  238.         $this->pricePerTask $pricePerTask;
  239.         return $this;
  240.     }
  241.     public function isTimePerTask(): bool
  242.     {
  243.         return $this->timePerTask;
  244.     }
  245.     public function setTimePerTask(bool $timePerTask): self
  246.     {
  247.         $this->timePerTask $timePerTask;
  248.         return $this;
  249.     }
  250.     public function getShortDescription(): ?string
  251.     {
  252.         return $this->shortDescription;
  253.     }
  254.     public function setShortDescription(?string $shortDescription): self
  255.     {
  256.         $this->shortDescription $shortDescription;
  257.         return $this;
  258.     }
  259. }