<?php
declare(strict_types=1);
namespace App\Entity\ProjectSimulation;
use App\Entity\Channel\Channel;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Sylius\Component\Resource\Model\ResourceInterface;
/**
* @ORM\Entity
* @ORM\Table(name="app_project_simulation")
*/
class ProjectSimulation implements ResourceInterface
{
use TimestampableEntity;
const ROOF_PITCH_COEFFICIENT = [
'0°' => 75,
'0°-15°' => 90,
'15°-25°' => 95,
'25°-45°' => 100,
'45°-60°' => 90,
'60°-90°' => 80,
];
const ROOF_ORIENTATION_COEFFICIENT = [
'Sud' => 100,
'Ouest' => 90,
'Sud-Ouest' => 95,
'Sud-Est' => 95,
'Est' => 90,
];
// key = surface en m2 / value = puissance
const POWER_BY_PANEL_SIZE = [
15 => 3,
20 => 4,
25 => 5,
30 => 6,
35 => 7,
40 => 8,
45 => 9,
50 => 10,
55 => 11,
60 => 12
];
const PRODUCTION_BY_DEPARTMENT = [
'01' => 1100,
'02' => 800,
'03' => 1100,
'04' => 1300,
'05' => 1300,
'06' => 1400,
'07' => 1300,
'08' => 800,
'09' => 1300,
'10' => 900,
'11' => 1300,
'12' => 1200,
'13' => 1400,
'14' => 900,
'15' => 1200,
'16' => 1200,
'17' => 1300,
'18' => 1000,
'19' => 1200,
'20' => 1400,
'21' => 1000,
'22' => 1000,
'23' => 1100,
'24' => 1200,
'25' => 900,
'26' => 1300,
'27' => 900,
'28' => 900,
'29' => 1000,
'30' => 1300,
'31' => 1200,
'32' => 1200,
'33' => 1300,
'34' => 1300,
'35' => 1000,
'36' => 1100,
'37' => 1100,
'38' => 1100,
'39' => 1000,
'40' => 1200,
'41' => 1000,
'42' => 1100,
'43' => 1200,
'44' => 1100,
'45' => 1000,
'46' => 1200,
'47' => 1200,
'48' => 1300,
'49' => 1100,
'50' => 1000,
'51' => 800,
'52' => 900,
'53' => 1000,
'54' => 800,
'55' => 800,
'56' => 1100,
'57' => 800,
'58' => 1000,
'59' => 800,
'60' => 800,
'61' => 1000,
'62' => 800,
'63' => 1100,
'64' => 1200,
'65' => 1200,
'66' => 1300,
'67' => 800,
'68' => 800,
'69' => 1100,
'70' => 900,
'71' => 1000,
'72' => 1000,
'73' => 1100,
'74' => 1100,
'75' => 900,
'76' => 900,
'77' => 900,
'78' => 900,
'79' => 1200,
'80' => 800,
'81' => 1200,
'82' => 1300,
'83' => 1400,
'84' => 1300,
'85' => 1300,
'86' => 1200,
'87' => 1200,
'88' => 800,
'89' => 1000,
'90' => 800,
'91' => 900,
'92' => 900,
'93' => 900,
'94' => 900,
'95' => 900
];
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* @ORM\Column(type="string", name="building_type", nullable=true)
*/
private ?string $buildingType = null;
/**
* @ORM\Column(type="string", nullable=true)
*/
private ?string $situation = null;
/**
* @ORM\Column(type="string", nullable=true)
*/
private ?string $department = null;
/**
* @ORM\Column(type="integer", name="year_of_construction", nullable=true)
*/
private ?int $yearOfConstruction = null;
//surface habitable
/**
* @ORM\Column(type="integer", name="living_space", nullable=true)
*/
private ?int $livingSpace = null;
//orientation du toit
/**
* @ORM\Column(type="string", name="roof_orientation", nullable=true)
*/
private ?string $roofOrientation = null;
//surface approximative du toit
/**
* @ORM\Column(type="integer", name="approximate_roof_area", nullable=true)
*/
private ?int $approximateRoofArea = null;
//inclinaison du toit
/**
* @ORM\Column(type="string", name="roof_pitch", nullable=true)
*/
private ?string $roofPitch = null;
//consommation annuelle kwh
/**
* @ORM\Column(type="integer", name="annual_consumption_kwh", nullable=true)
*/
private ?int $annualConsumptionKwh = null;
//surface en m2 des panneaux photovoltaïques
/**
* @ORM\Column(type="integer", name="panel_size", nullable=true)
*/
private ?int $panelSize = null;
//type de chauffage
/**
* @ORM\Column(type="string", name="type_of_heating", nullable=true)
*/
private ?string $typeOfHeating = null;
//type de chauffage
/**
* @ORM\Column(type="string", name="type_of_domestic_hot_water", nullable=true)
*/
private ?string $typeOfDomesticHotWater = null;
//climatisation
/**
* @ORM\Column(type="boolean", name="air_conditioner", nullable=true, options={"default" : 0})
*/
private bool $airConditioner = false;
//piscine de plus de 30m3
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
*/
private bool $pool = false;
/**
* @ORM\Column(type="string", name="email", nullable=true)
*/
private ?string $email = null;
/**
* @ORM\Column(type="string", name="phone", nullable=true)
*/
private ?string $phone = null;
//si true alors la demande est traitée
/**
* @ORM\Column(type="boolean", nullable=true, options={"default" : 0})
*/
private bool $processed = false;
/**
* @ORM\OneToMany(targetEntity=ProjectSimulationFile::class, mappedBy="projectSimulation", orphanRemoval=true, cascade={"persist"})
*/
private $files;
/**
* @ORM\Column(type="string", name="locale_code", nullable=true)
*/
private ?string $localeCode = null;
/**
* @ORM\ManyToOne("App\Entity\Channel\Channel")
* @ORM\JoinColumn(name="channel_id", referencedColumnName="id")
*/
private Channel $channel;
/**
* @return int|null
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @param int|null $id
*/
public function setId(?int $id): void
{
$this->id = $id;
}
/**
* @return string|null
*/
public function getBuildingType(): ?string
{
return $this->buildingType;
}
/**
* @param string|null $buildingType
*/
public function setBuildingType(?string $buildingType): void
{
$this->buildingType = $buildingType;
}
/**
* @return string|null
*/
public function getSituation(): ?string
{
return $this->situation;
}
/**
* @param string|null $situation
*/
public function setSituation(?string $situation): void
{
$this->situation = $situation;
}
/**
* @return int|null
*/
public function getYearOfConstruction(): ?int
{
return $this->yearOfConstruction;
}
/**
* @param int|null $yearOfConstruction
*/
public function setYearOfConstruction(?int $yearOfConstruction): void
{
$this->yearOfConstruction = $yearOfConstruction;
}
/**
* @return int|null
*/
public function getLivingSpace(): ?int
{
return $this->livingSpace;
}
/**
* @param int|null $livingSpace
*/
public function setLivingSpace(?int $livingSpace): void
{
$this->livingSpace = $livingSpace;
}
/**
* @return string|null
*/
public function getRoofOrientation(): ?string
{
return $this->roofOrientation;
}
/**
* @param string|null $roofOrientation
*/
public function setRoofOrientation(?string $roofOrientation): void
{
$this->roofOrientation = $roofOrientation;
}
/**
* @return int|null
*/
public function getApproximateRoofArea(): ?int
{
return $this->approximateRoofArea;
}
/**
* @param int|null $approximateRoofArea
*/
public function setApproximateRoofArea(?int $approximateRoofArea): void
{
$this->approximateRoofArea = $approximateRoofArea;
}
/**
* @return string|null
*/
public function getRoofPitch(): ?string
{
return $this->roofPitch;
}
/**
* @param string|null $roofPitch
*/
public function setRoofPitch(?string $roofPitch): void
{
$this->roofPitch = $roofPitch;
}
/**
* @return int|null
*/
public function getAnnualConsumptionKwh(): ?int
{
return $this->annualConsumptionKwh;
}
/**
* @param int|null $annualConsumptionKwh
*/
public function setAnnualConsumptionKwh(?int $annualConsumptionKwh): void
{
$this->annualConsumptionKwh = $annualConsumptionKwh;
}
/**
* @return string|null
*/
public function getTypeOfHeating(): ?string
{
return $this->typeOfHeating;
}
/**
* @param string|null $typeOfHeating
*/
public function setTypeOfHeating(?string $typeOfHeating): void
{
$this->typeOfHeating = $typeOfHeating;
}
/**
* @return bool
*/
public function isAirConditioner(): bool
{
return $this->airConditioner;
}
/**
* @param bool $airConditioner
*/
public function setAirConditioner(bool $airConditioner): void
{
$this->airConditioner = $airConditioner;
}
/**
* @return bool
*/
public function isPool(): bool
{
return $this->pool;
}
/**
* @param bool $pool
*/
public function setPool(bool $pool): void
{
$this->pool = $pool;
}
/**
* @return string|null
*/
public function getEmail(): ?string
{
return $this->email;
}
/**
* @param string|null $email
*/
public function setEmail(?string $email): void
{
$this->email = $email;
}
/**
* @return bool
*/
public function isProcessed(): bool
{
return $this->processed;
}
/**
* @param bool $processed
*/
public function setProcessed(bool $processed): void
{
$this->processed = $processed;
}
/**
* @return Collection<int, ProjectSimulationFile>
*/
public function getFiles(): Collection
{
return $this->files;
}
public function addFile(ProjectSimulationFile $file): self
{
if (!$this->files->contains($file)) {
$this->files[] = $file;
$file->setProjectSimulation($this);
}
return $this;
}
public function removeFile(ProjectSimulationFile $file): self
{
if ($this->files->removeElement($file)) {
// set the owning side to null (unless already changed)
if ($file->getProjectSimulation() === $this) {
$file->setProjectSimulation(null);
}
}
return $this;
}
/**
* @return string|null
*/
public function getLocaleCode(): ?string
{
return $this->localeCode;
}
/**
* @param string|null $localeCode
*/
public function setLocaleCode(?string $localeCode): void
{
$this->localeCode = $localeCode;
}
/**
* @return Channel
*/
public function getChannel(): Channel
{
return $this->channel;
}
/**
* @param Channel $channel
*/
public function setChannel(Channel $channel): void
{
$this->channel = $channel;
}
/**
* @return string|null
*/
public function getTypeOfDomesticHotWater(): ?string
{
return $this->typeOfDomesticHotWater;
}
/**
* @param string|null $typeOfDomesticHotWater
*/
public function setTypeOfDomesticHotWater(?string $typeOfDomesticHotWater): void
{
$this->typeOfDomesticHotWater = $typeOfDomesticHotWater;
}
public function getDepartment(): ?string
{
return $this->department;
}
public function setDepartment(?string $department): void
{
$this->department = $department;
}
public function getPanelSize(): ?int
{
return $this->panelSize;
}
public function setPanelSize(?int $panelSize): void
{
$this->panelSize = $panelSize;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): void
{
$this->phone = $phone;
}
}