src/Entity/ProjectSimulation/ProjectSimulation.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\ProjectSimulation;
  4. use App\Entity\Channel\Channel;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Timestampable\Traits\TimestampableEntity;
  8. use Sylius\Component\Resource\Model\ResourceInterface;
  9. /**
  10.  * @ORM\Entity
  11.  * @ORM\Table(name="app_project_simulation")
  12.  */
  13. class ProjectSimulation implements  ResourceInterface
  14. {
  15.     use TimestampableEntity;
  16.     const ROOF_PITCH_COEFFICIENT = [
  17.         '0°' => 75,
  18.         '0°-15°' => 90,
  19.         '15°-25°' => 95,
  20.         '25°-45°' => 100,
  21.         '45°-60°' => 90,
  22.         '60°-90°' => 80,
  23.     ];
  24.     const ROOF_ORIENTATION_COEFFICIENT = [
  25.         'Sud' => 100,
  26.         'Ouest' => 90,
  27.         'Sud-Ouest' => 95,
  28.         'Sud-Est' => 95,
  29.         'Est' => 90,
  30.     ];
  31.     // key = surface en m2 / value = puissance
  32.     const POWER_BY_PANEL_SIZE = [
  33.         15 => 3,
  34.         20 => 4,
  35.         25 => 5,
  36.         30 => 6,
  37.         35 => 7,
  38.         40 => 8,
  39.         45 => 9,
  40.         50 => 10,
  41.         55 => 11,
  42.         60 => 12
  43.     ];
  44.     const PRODUCTION_BY_DEPARTMENT = [
  45.         '01' => 1100,
  46.         '02' => 800,
  47.         '03' => 1100,
  48.         '04' => 1300,
  49.         '05' => 1300,
  50.         '06' => 1400,
  51.         '07' => 1300,
  52.         '08' => 800,
  53.         '09' => 1300,
  54.         '10' => 900,
  55.         '11' => 1300,
  56.         '12' => 1200,
  57.         '13' => 1400,
  58.         '14' => 900,
  59.         '15' => 1200,
  60.         '16' => 1200,
  61.         '17' => 1300,
  62.         '18' => 1000,
  63.         '19' => 1200,
  64.         '20' => 1400,
  65.         '21' => 1000,
  66.         '22' => 1000,
  67.         '23' => 1100,
  68.         '24' => 1200,
  69.         '25' => 900,
  70.         '26' => 1300,
  71.         '27' => 900,
  72.         '28' => 900,
  73.         '29' => 1000,
  74.         '30' => 1300,
  75.         '31' => 1200,
  76.         '32' => 1200,
  77.         '33' => 1300,
  78.         '34' => 1300,
  79.         '35' => 1000,
  80.         '36' => 1100,
  81.         '37' => 1100,
  82.         '38' => 1100,
  83.         '39' => 1000,
  84.         '40' => 1200,
  85.         '41' => 1000,
  86.         '42' => 1100,
  87.         '43' => 1200,
  88.         '44' => 1100,
  89.         '45' => 1000,
  90.         '46' => 1200,
  91.         '47' => 1200,
  92.         '48' => 1300,
  93.         '49' => 1100,
  94.         '50' => 1000,
  95.         '51' => 800,
  96.         '52' => 900,
  97.         '53' => 1000,
  98.         '54' => 800,
  99.         '55' => 800,
  100.         '56' => 1100,
  101.         '57' => 800,
  102.         '58' => 1000,
  103.         '59' => 800,
  104.         '60' => 800,
  105.         '61' => 1000,
  106.         '62' => 800,
  107.         '63' => 1100,
  108.         '64' => 1200,
  109.         '65' => 1200,
  110.         '66' => 1300,
  111.         '67' => 800,
  112.         '68' => 800,
  113.         '69' => 1100,
  114.         '70' => 900,
  115.         '71' => 1000,
  116.         '72' => 1000,
  117.         '73' => 1100,
  118.         '74' => 1100,
  119.         '75' => 900,
  120.         '76' => 900,
  121.         '77' => 900,
  122.         '78' => 900,
  123.         '79' => 1200,
  124.         '80' => 800,
  125.         '81' => 1200,
  126.         '82' => 1300,
  127.         '83' => 1400,
  128.         '84' => 1300,
  129.         '85' => 1300,
  130.         '86' => 1200,
  131.         '87' => 1200,
  132.         '88' => 800,
  133.         '89' => 1000,
  134.         '90' => 800,
  135.         '91' => 900,
  136.         '92' => 900,
  137.         '93' => 900,
  138.         '94' => 900,
  139.         '95' => 900
  140.     ];
  141.     /**
  142.      * @ORM\Id()
  143.      * @ORM\GeneratedValue()
  144.      * @ORM\Column(type="integer")
  145.      */
  146.     private ?int $id null;
  147.     /**
  148.      * @ORM\Column(type="string", name="building_type", nullable=true)
  149.      */
  150.     private ?string $buildingType null;
  151.     /**
  152.      * @ORM\Column(type="string", nullable=true)
  153.      */
  154.     private ?string $situation null;
  155.     /**
  156.      * @ORM\Column(type="string", nullable=true)
  157.      */
  158.     private ?string $department null;
  159.     /**
  160.      * @ORM\Column(type="integer", name="year_of_construction", nullable=true)
  161.      */
  162.     private ?int $yearOfConstruction null;
  163.     //surface habitable
  164.     /**
  165.      * @ORM\Column(type="integer", name="living_space", nullable=true)
  166.      */
  167.     private ?int $livingSpace null;
  168.     //orientation du toit
  169.     /**
  170.      * @ORM\Column(type="string", name="roof_orientation", nullable=true)
  171.      */
  172.     private ?string $roofOrientation null;
  173.     //surface approximative du toit
  174.     /**
  175.      * @ORM\Column(type="integer", name="approximate_roof_area", nullable=true)
  176.      */
  177.     private ?int $approximateRoofArea null;
  178.     //inclinaison du toit
  179.     /**
  180.      * @ORM\Column(type="string", name="roof_pitch", nullable=true)
  181.      */
  182.     private ?string $roofPitch null;
  183.     //consommation annuelle kwh
  184.     /**
  185.      * @ORM\Column(type="integer", name="annual_consumption_kwh", nullable=true)
  186.      */
  187.     private ?int $annualConsumptionKwh null;
  188.     //surface en m2 des panneaux photovoltaïques
  189.     /**
  190.      * @ORM\Column(type="integer", name="panel_size", nullable=true)
  191.      */
  192.     private ?int $panelSize null;
  193.     //type de chauffage
  194.     /**
  195.      * @ORM\Column(type="string", name="type_of_heating",  nullable=true)
  196.      */
  197.     private ?string $typeOfHeating null;
  198.     //type de chauffage
  199.     /**
  200.      * @ORM\Column(type="string", name="type_of_domestic_hot_water",  nullable=true)
  201.      */
  202.     private ?string $typeOfDomesticHotWater null;
  203.     //climatisation
  204.     /**
  205.      * @ORM\Column(type="boolean", name="air_conditioner", nullable=true, options={"default" : 0})
  206.      */
  207.     private bool $airConditioner false;
  208.     //piscine de plus de 30m3
  209.     /**
  210.      * @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
  211.      */
  212.     private bool $pool false;
  213.     /**
  214.      * @ORM\Column(type="string", name="email",  nullable=true)
  215.      */
  216.     private ?string $email null;
  217.     /**
  218.      * @ORM\Column(type="string", name="phone",  nullable=true)
  219.      */
  220.     private ?string $phone null;
  221.     //si true alors la demande est traitée
  222.     /**
  223.      * @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
  224.      */
  225.     private bool $processed false;
  226.     /**
  227.      * @ORM\OneToMany(targetEntity=ProjectSimulationFile::class, mappedBy="projectSimulation", orphanRemoval=true, cascade={"persist"})
  228.      */
  229.     private $files;
  230.     /**
  231.      * @ORM\Column(type="string", name="locale_code",  nullable=true)
  232.      */
  233.     private ?string $localeCode null;
  234.     /**
  235.      * @ORM\ManyToOne("App\Entity\Channel\Channel")
  236.      * @ORM\JoinColumn(name="channel_id", referencedColumnName="id")
  237.      */
  238.     private Channel $channel;
  239.     /**
  240.      * @return int|null
  241.      */
  242.     public function getId(): ?int
  243.     {
  244.         return $this->id;
  245.     }
  246.     /**
  247.      * @param int|null $id
  248.      */
  249.     public function setId(?int $id): void
  250.     {
  251.         $this->id $id;
  252.     }
  253.     /**
  254.      * @return string|null
  255.      */
  256.     public function getBuildingType(): ?string
  257.     {
  258.         return $this->buildingType;
  259.     }
  260.     /**
  261.      * @param string|null $buildingType
  262.      */
  263.     public function setBuildingType(?string $buildingType): void
  264.     {
  265.         $this->buildingType $buildingType;
  266.     }
  267.     /**
  268.      * @return string|null
  269.      */
  270.     public function getSituation(): ?string
  271.     {
  272.         return $this->situation;
  273.     }
  274.     /**
  275.      * @param string|null $situation
  276.      */
  277.     public function setSituation(?string $situation): void
  278.     {
  279.         $this->situation $situation;
  280.     }
  281.     /**
  282.      * @return int|null
  283.      */
  284.     public function getYearOfConstruction(): ?int
  285.     {
  286.         return $this->yearOfConstruction;
  287.     }
  288.     /**
  289.      * @param int|null $yearOfConstruction
  290.      */
  291.     public function setYearOfConstruction(?int $yearOfConstruction): void
  292.     {
  293.         $this->yearOfConstruction $yearOfConstruction;
  294.     }
  295.     /**
  296.      * @return int|null
  297.      */
  298.     public function getLivingSpace(): ?int
  299.     {
  300.         return $this->livingSpace;
  301.     }
  302.     /**
  303.      * @param int|null $livingSpace
  304.      */
  305.     public function setLivingSpace(?int $livingSpace): void
  306.     {
  307.         $this->livingSpace $livingSpace;
  308.     }
  309.     /**
  310.      * @return string|null
  311.      */
  312.     public function getRoofOrientation(): ?string
  313.     {
  314.         return $this->roofOrientation;
  315.     }
  316.     /**
  317.      * @param string|null $roofOrientation
  318.      */
  319.     public function setRoofOrientation(?string $roofOrientation): void
  320.     {
  321.         $this->roofOrientation $roofOrientation;
  322.     }
  323.     /**
  324.      * @return int|null
  325.      */
  326.     public function getApproximateRoofArea(): ?int
  327.     {
  328.         return $this->approximateRoofArea;
  329.     }
  330.     /**
  331.      * @param int|null $approximateRoofArea
  332.      */
  333.     public function setApproximateRoofArea(?int $approximateRoofArea): void
  334.     {
  335.         $this->approximateRoofArea $approximateRoofArea;
  336.     }
  337.     /**
  338.      * @return string|null
  339.      */
  340.     public function getRoofPitch(): ?string
  341.     {
  342.         return $this->roofPitch;
  343.     }
  344.     /**
  345.      * @param string|null $roofPitch
  346.      */
  347.     public function setRoofPitch(?string $roofPitch): void
  348.     {
  349.         $this->roofPitch $roofPitch;
  350.     }
  351.     /**
  352.      * @return int|null
  353.      */
  354.     public function getAnnualConsumptionKwh(): ?int
  355.     {
  356.         return $this->annualConsumptionKwh;
  357.     }
  358.     /**
  359.      * @param int|null $annualConsumptionKwh
  360.      */
  361.     public function setAnnualConsumptionKwh(?int $annualConsumptionKwh): void
  362.     {
  363.         $this->annualConsumptionKwh $annualConsumptionKwh;
  364.     }
  365.     /**
  366.      * @return string|null
  367.      */
  368.     public function getTypeOfHeating(): ?string
  369.     {
  370.         return $this->typeOfHeating;
  371.     }
  372.     /**
  373.      * @param string|null $typeOfHeating
  374.      */
  375.     public function setTypeOfHeating(?string $typeOfHeating): void
  376.     {
  377.         $this->typeOfHeating $typeOfHeating;
  378.     }
  379.     /**
  380.      * @return bool
  381.      */
  382.     public function isAirConditioner(): bool
  383.     {
  384.         return $this->airConditioner;
  385.     }
  386.     /**
  387.      * @param bool $airConditioner
  388.      */
  389.     public function setAirConditioner(bool $airConditioner): void
  390.     {
  391.         $this->airConditioner $airConditioner;
  392.     }
  393.     /**
  394.      * @return bool
  395.      */
  396.     public function isPool(): bool
  397.     {
  398.         return $this->pool;
  399.     }
  400.     /**
  401.      * @param bool $pool
  402.      */
  403.     public function setPool(bool $pool): void
  404.     {
  405.         $this->pool $pool;
  406.     }
  407.     /**
  408.      * @return string|null
  409.      */
  410.     public function getEmail(): ?string
  411.     {
  412.         return $this->email;
  413.     }
  414.     /**
  415.      * @param string|null $email
  416.      */
  417.     public function setEmail(?string $email): void
  418.     {
  419.         $this->email $email;
  420.     }
  421.     /**
  422.      * @return bool
  423.      */
  424.     public function isProcessed(): bool
  425.     {
  426.         return $this->processed;
  427.     }
  428.     /**
  429.      * @param bool $processed
  430.      */
  431.     public function setProcessed(bool $processed): void
  432.     {
  433.         $this->processed $processed;
  434.     }
  435.     /**
  436.      * @return Collection<int, ProjectSimulationFile>
  437.      */
  438.     public function getFiles(): Collection
  439.     {
  440.         return $this->files;
  441.     }
  442.     public function addFile(ProjectSimulationFile $file): self
  443.     {
  444.         if (!$this->files->contains($file)) {
  445.             $this->files[] = $file;
  446.             $file->setProjectSimulation($this);
  447.         }
  448.         return $this;
  449.     }
  450.     public function removeFile(ProjectSimulationFile $file): self
  451.     {
  452.         if ($this->files->removeElement($file)) {
  453.             // set the owning side to null (unless already changed)
  454.             if ($file->getProjectSimulation() === $this) {
  455.                 $file->setProjectSimulation(null);
  456.             }
  457.         }
  458.         return $this;
  459.     }
  460.     /**
  461.      * @return string|null
  462.      */
  463.     public function getLocaleCode(): ?string
  464.     {
  465.         return $this->localeCode;
  466.     }
  467.     /**
  468.      * @param string|null $localeCode
  469.      */
  470.     public function setLocaleCode(?string $localeCode): void
  471.     {
  472.         $this->localeCode $localeCode;
  473.     }
  474.     /**
  475.      * @return Channel
  476.      */
  477.     public function getChannel(): Channel
  478.     {
  479.         return $this->channel;
  480.     }
  481.     /**
  482.      * @param Channel $channel
  483.      */
  484.     public function setChannel(Channel $channel): void
  485.     {
  486.         $this->channel $channel;
  487.     }
  488.     /**
  489.      * @return string|null
  490.      */
  491.     public function getTypeOfDomesticHotWater(): ?string
  492.     {
  493.         return $this->typeOfDomesticHotWater;
  494.     }
  495.     /**
  496.      * @param string|null $typeOfDomesticHotWater
  497.      */
  498.     public function setTypeOfDomesticHotWater(?string $typeOfDomesticHotWater): void
  499.     {
  500.         $this->typeOfDomesticHotWater $typeOfDomesticHotWater;
  501.     }
  502.     public function getDepartment(): ?string
  503.     {
  504.         return $this->department;
  505.     }
  506.     public function setDepartment(?string $department): void
  507.     {
  508.         $this->department $department;
  509.     }
  510.     public function getPanelSize(): ?int
  511.     {
  512.         return $this->panelSize;
  513.     }
  514.     public function setPanelSize(?int $panelSize): void
  515.     {
  516.         $this->panelSize $panelSize;
  517.     }
  518.     public function getPhone(): ?string
  519.     {
  520.         return $this->phone;
  521.     }
  522.     public function setPhone(?string $phone): void
  523.     {
  524.         $this->phone $phone;
  525.     }
  526. }