src/Entity/Engagement/EngagementVersion.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Engagement;
  3. use App\Entity\DocUpload;
  4. use App\Repository\EngagementVersionRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use App\Annotation\CustomAnnotation;
  9. /**
  10.  * @ORM\Entity(repositoryClass=EngagementVersionRepository::class)
  11.  */
  12. class EngagementVersion
  13. {
  14.     const CAT_Prospection = 1;
  15.     const CAT_Montage_Administratif = 2;
  16.     const CAT_Developpement = 3;
  17.     const CAT_Construction = 4;
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity="EngagementProjet", cascade={"persist"}, inversedBy="engagementVersion")
  26.      * @ORM\JoinColumn(name="engagement_projet_id", referencedColumnName="id",nullable=true)
  27.      */
  28.     private $engagementProjet;
  29.     /**
  30.      * @ORM\OneToMany(targetEntity="EngagementBudget",mappedBy="engagementVersion", cascade={"persist"})
  31.      */
  32.     private $engagementBudget;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity="\App\Entity\DocUpload", cascade={"persist"})
  35.      * @ORM\JoinColumn(name="file_budget_id", referencedColumnName="id",nullable=true,onDelete="SET NULL")
  36.      * @CustomAnnotation("File budget")
  37.      */
  38.     private $fileBudget;
  39.     /**
  40.      * @ORM\ManyToOne(targetEntity="\App\Entity\DocUpload", cascade={"persist"})
  41.      * @ORM\JoinColumn(name="file_business_plan_id", referencedColumnName="id",nullable=true,onDelete="SET NULL")
  42.      * @CustomAnnotation("Business plan")
  43.      */
  44.     private $fileBusinessPlan;
  45.     /**
  46.      * Plusieurs versions peuvent référencer le même jalon (liste partagée) → ManyToOne.
  47.      * @ORM\ManyToOne(targetEntity="EngagementJalon", cascade={"persist"})
  48.      * @ORM\JoinColumn(name="engagement_jalon_id", referencedColumnName="id",nullable=true)
  49.      */
  50.     private $engagementJalon;
  51.     /**
  52.      * @ORM\Column(type="float", nullable=true)
  53.      * @CustomAnnotation("Prospection Montant")
  54.      */
  55.     private $prospectionMontant;
  56.     /**
  57.      * @ORM\Column(type="float", nullable=true)
  58.      * @CustomAnnotation("Montage administratif Montant")
  59.      */
  60.     private $montageAdministratifMontant;
  61.     /**
  62.      * @ORM\Column(type="float", nullable=true)
  63.      * @CustomAnnotation("Développement Montant")
  64.      */
  65.     private $developpementMontant;
  66.     /**
  67.      * @ORM\Column(type="float", nullable=true)
  68.      * @CustomAnnotation("Construction Montant")
  69.      */
  70.     private $constructionMontant;
  71.     /**
  72.      * Ratios financiers (dernier tableau de la Fiche transfert).
  73.      * @ORM\Column(type="float", nullable=true)
  74.      * @CustomAnnotation("EBE/CAPEX")
  75.      */
  76.     private $ebeCapex;
  77.     /**
  78.      * @ORM\Column(type="float", nullable=true)
  79.      * @CustomAnnotation("TRI Equity")
  80.      */
  81.     private $equity;
  82.     /**
  83.      * @ORM\Column(type="float", nullable=true)
  84.      * @CustomAnnotation("Dette")
  85.      */
  86.     private $dette;
  87.     /**
  88.      * @ORM\Column(type="text",  nullable=true)
  89.      */
  90.     private $comment;
  91.     /**
  92.      * @ORM\Column(type="datetime", nullable=true)
  93.      */
  94.     private $createdAt;
  95.     /**
  96.      * @ORM\Column(type="text", nullable=true)
  97.      */
  98.     private $token;
  99.     /**
  100.      * @ORM\Column(type="boolean", nullable=true)
  101.      */
  102.     private $isVersion;
  103.     public function __construct()
  104.     {
  105.         $this->createdAt = new \DateTime();
  106.         $this->token =  md5(uniqid());
  107.         $this->engagementBudget = new ArrayCollection();
  108.     }
  109.     public function getId(): ?int
  110.     {
  111.         return $this->id;
  112.     }
  113.     public function getProspectionMontant(): ?float
  114.     {
  115.         return $this->prospectionMontant;
  116.     }
  117.     public function setProspectionMontant(?float $prospectionMontant): self
  118.     {
  119.         $this->prospectionMontant = $prospectionMontant;
  120.         return $this;
  121.     }
  122.     public function getMontageAdministratifMontant(): ?float
  123.     {
  124.         return $this->montageAdministratifMontant;
  125.     }
  126.     public function setMontageAdministratifMontant(?float $montageAdministratifMontant): self
  127.     {
  128.         $this->montageAdministratifMontant = $montageAdministratifMontant;
  129.         return $this;
  130.     }
  131.     public function getDeveloppementMontant(): ?float
  132.     {
  133.         return $this->developpementMontant;
  134.     }
  135.     public function setDeveloppementMontant(?float $developpementMontant): self
  136.     {
  137.         $this->developpementMontant = $developpementMontant;
  138.         return $this;
  139.     }
  140.     public function getConstructionMontant(): ?float
  141.     {
  142.         return $this->constructionMontant;
  143.     }
  144.     public function setConstructionMontant(?float $constructionMontant): self
  145.     {
  146.         $this->constructionMontant = $constructionMontant;
  147.         return $this;
  148.     }
  149.     public function getEbeCapex(): ?float
  150.     {
  151.         return $this->ebeCapex;
  152.     }
  153.     public function setEbeCapex(?float $ebeCapex): self
  154.     {
  155.         $this->ebeCapex = $ebeCapex;
  156.         return $this;
  157.     }
  158.     public function getEquity(): ?float
  159.     {
  160.         return $this->equity;
  161.     }
  162.     public function setEquity(?float $equity): self
  163.     {
  164.         $this->equity = $equity;
  165.         return $this;
  166.     }
  167.     public function getDette(): ?float
  168.     {
  169.         return $this->dette;
  170.     }
  171.     public function setDette(?float $dette): self
  172.     {
  173.         $this->dette = $dette;
  174.         return $this;
  175.     }
  176.     public function getComment(): ?string
  177.     {
  178.         return $this->comment;
  179.     }
  180.     public function setComment(?string $comment): self
  181.     {
  182.         $this->comment = $comment;
  183.         return $this;
  184.     }
  185.     public function getCreatedAt(): ?\DateTimeInterface
  186.     {
  187.         return $this->createdAt;
  188.     }
  189.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  190.     {
  191.         $this->createdAt = $createdAt;
  192.         return $this;
  193.     }
  194.     public function getToken(): ?string
  195.     {
  196.         return $this->token;
  197.     }
  198.     public function setToken(?string $token): self
  199.     {
  200.         $this->token = $token;
  201.         return $this;
  202.     }
  203.     public function getEngagementProjet(): ?EngagementProjet
  204.     {
  205.         return $this->engagementProjet;
  206.     }
  207.     public function setEngagementProjet(?EngagementProjet $engagementProjet): self
  208.     {
  209.         $this->engagementProjet = $engagementProjet;
  210.         return $this;
  211.     }
  212.     /**
  213.      * @return Collection|EngagementBudget[]
  214.      */
  215.     public function getEngagementBudget(): Collection
  216.     {
  217.         return $this->engagementBudget;
  218.     }
  219.     public function addEngagementBudget(EngagementBudget $engagementBudget): self
  220.     {
  221.         if (!$this->engagementBudget->contains($engagementBudget)) {
  222.             $this->engagementBudget[] = $engagementBudget;
  223.             $engagementBudget->setEngagementVersion($this);
  224.         }
  225.         return $this;
  226.     }
  227.     public function removeEngagementBudget(EngagementBudget $engagementBudget): self
  228.     {
  229.         if ($this->engagementBudget->removeElement($engagementBudget)) {
  230.             // set the owning side to null (unless already changed)
  231.             if ($engagementBudget->getEngagementVersion() === $this) {
  232.                 $engagementBudget->setEngagementVersion(null);
  233.             }
  234.         }
  235.         return $this;
  236.     }
  237.     public function getFileBusinessPlan(): ?DocUpload
  238.     {
  239.         return $this->fileBusinessPlan;
  240.     }
  241.     public function setFileBusinessPlan(?DocUpload $fileBusinessPlan): self
  242.     {
  243.         $this->fileBusinessPlan = $fileBusinessPlan;
  244.         return $this;
  245.     }
  246.     public function getFileBudget(): ?DocUpload
  247.     {
  248.         return $this->fileBudget;
  249.     }
  250.     public function setFileBudget(?DocUpload $fileBudget): self
  251.     {
  252.         $this->fileBudget = $fileBudget;
  253.         return $this;
  254.     }
  255.     public function getEngagementJalon(): ?EngagementJalon
  256.     {
  257.         return $this->engagementJalon;
  258.     }
  259.     public function setEngagementJalon(?EngagementJalon $engagementJalon): self
  260.     {
  261.         $this->engagementJalon = $engagementJalon;
  262.         return $this;
  263.     }
  264.     public function getIsVersion(): ?bool
  265.     {
  266.         return $this->isVersion;
  267.     }
  268.     public function setIsVersion(?bool $isVersion): self
  269.     {
  270.         $this->isVersion = $isVersion;
  271.         return $this;
  272.     }
  273. }