src/Entity/Tranche.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TrancheRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=TrancheRepository::class)
  9.  */
  10. class Tranche
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=500)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=Contract::class, inversedBy="tranches")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $contract;
  27.     /**
  28.      * @ORM\Column(type="date", nullable=true)
  29.      */
  30.     private $paymentDate;
  31.     /**
  32.      * @ORM\Column(type="date")
  33.      */
  34.     private $executionDate;
  35.     /**
  36.      * @ORM\OneToMany(targetEntity=Task::class, mappedBy="tranche")
  37.      * @ORM\OrderBy({"orderTask": "ASC"})
  38.      */
  39.     private $tasks;
  40.     /**
  41.      * @ORM\Column(type="decimal", precision=10, scale=2)
  42.      */
  43.     private $billableValue;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity=FacturaBody::class, mappedBy="tranche")
  46.      */
  47.     private $facturaBodies;
  48.     /**
  49.      * @ORM\Column(type="string", length=500, nullable=true)
  50.      */
  51.     private $facturaRowTxt;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity=Unit::class)
  54.      * @ORM\JoinColumn(nullable=false)
  55.      */
  56.     private $unit;
  57.     public function __construct()
  58.     {
  59.         $this->tasks = new ArrayCollection();
  60.         $this->facturaBodies = new ArrayCollection();
  61.     }
  62.     public function getId(): ?int
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getName(): ?string
  67.     {
  68.         return $this->name;
  69.     }
  70.     public function setName(string $name): self
  71.     {
  72.         $this->name $name;
  73.         return $this;
  74.     }
  75.     public function getContract(): ?Contract
  76.     {
  77.         return $this->contract;
  78.     }
  79.     public function setContract(?Contract $contract): self
  80.     {
  81.         $this->contract $contract;
  82.         return $this;
  83.     }
  84.     public function getPaymentDate(): ?\DateTimeInterface
  85.     {
  86.         return $this->paymentDate;
  87.     }
  88.     public function setPaymentDate(?\DateTimeInterface $paymentDate): self
  89.     {
  90.         $this->paymentDate $paymentDate;
  91.         return $this;
  92.     }
  93.     public function getExecutionDate(): ?\DateTimeInterface
  94.     {
  95.         return $this->executionDate;
  96.     }
  97.     public function setExecutionDate(\DateTimeInterface $executionDate): self
  98.     {
  99.         $this->executionDate $executionDate;
  100.         return $this;
  101.     }
  102.     /**
  103.      * @return Collection<int, Task>
  104.      */
  105.     public function getTasks(): Collection
  106.     {
  107.         return $this->tasks;
  108.     }
  109.     public function addTask(Task $task): self
  110.     {
  111.         if (!$this->tasks->contains($task)) {
  112.             $this->tasks[] = $task;
  113.             $task->setTranche($this);
  114.         }
  115.         return $this;
  116.     }
  117.     public function removeTask(Task $task): self
  118.     {
  119.         if ($this->tasks->removeElement($task)) {
  120.             // set the owning side to null (unless already changed)
  121.             if ($task->getTranche() === $this) {
  122.                 $task->setTranche(null);
  123.             }
  124.         }
  125.         return $this;
  126.     }
  127.     public function getBillableValue(): ?string
  128.     {
  129.         return $this->billableValue;
  130.     }
  131.     public function setBillableValue(string $billableValue): self
  132.     {
  133.         $this->billableValue $billableValue;
  134.         return $this;
  135.     }
  136.     /**
  137.      * @return Collection<int, FacturaBody>
  138.      */
  139.     public function getFacturaBodies(): Collection
  140.     {
  141.         return $this->facturaBodies;
  142.     }
  143.     public function addFacturaBody(FacturaBody $facturaBody): self
  144.     {
  145.         if (!$this->facturaBodies->contains($facturaBody)) {
  146.             $this->facturaBodies[] = $facturaBody;
  147.             $facturaBody->setTranche($this);
  148.         }
  149.         return $this;
  150.     }
  151.     public function removeFacturaBody(FacturaBody $facturaBody): self
  152.     {
  153.         if ($this->facturaBodies->removeElement($facturaBody)) {
  154.             // set the owning side to null (unless already changed)
  155.             if ($facturaBody->getTranche() === $this) {
  156.                 $facturaBody->setTranche(null);
  157.             }
  158.         }
  159.         return $this;
  160.     }
  161.     public function getFacturaRowTxt(): ?string
  162.     {
  163.         return $this->facturaRowTxt;
  164.     }
  165.     public function setFacturaRowTxt(?string $facturaRowTxt): self
  166.     {
  167.         $this->facturaRowTxt $facturaRowTxt;
  168.         return $this;
  169.     }
  170.     public function getUnit(): ?Unit
  171.     {
  172.         return $this->unit;
  173.     }
  174.     public function setUnit(?Unit $unit): self
  175.     {
  176.         $this->unit $unit;
  177.         return $this;
  178.     }
  179. }