src/Entity/BuildingReportingHistory.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BuildingReportingHistoryRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassBuildingReportingHistoryRepository::class)]
  7. class BuildingReportingHistory
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'buildingReportingHistoriesUser')]
  14.     private ?User $user null;
  15.     #[ORM\Column(nullabletrue)]
  16.     private ?\DateTimeImmutable $createdAt null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $type null;
  19.     #[ORM\ManyToOne(inversedBy'buildingReportingHistories')]
  20.     private ?Building $building null;
  21.     #[ORM\ManyToOne(inversedBy'buildingReportingHistories')]
  22.     private ?City $city null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $street null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $numberStreet null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $postalCode null;
  29.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  30.     private ?\DateTimeInterface $dateStartLease null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $statusBuilding null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $statusAnnouncment null;
  35.     #[ORM\Column(length255nullabletrue)]
  36.     private ?string $numberId null;
  37.     #[ORM\Column(length255nullabletrue)]
  38.     private ?string $country null;
  39.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  40.     private ?string $detail null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $number null;
  43.     public function __construct()
  44.     {
  45.         $this->createdAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Paris'));
  46.     }
  47.     public function getExportData(): array
  48.     {
  49.         return \array_merge([
  50.             'id' => $this->numberId,
  51.             'user' => $this->user?->getId(),
  52.             'date' => $this->createdAt->format('d/m/Y H:i'),
  53.             'type' => $this->type,
  54.             'building' => $this->building?->getId(),
  55.             'city' => $this->city?->getCity(),
  56.             'street' => $this->street,
  57.             'numberStreet' => $this->numberStreet,
  58.             'postalCode' => $this->postalCode,
  59.             'dateAvailable' => $this->dateStartLease?->format('d/m/Y'),
  60.             'statusBuilding' => $this->statusBuilding,
  61.             'statusAnnouncment' => $this->statusAnnouncment,
  62.         ]);
  63.     }
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function getUser(): ?User
  69.     {
  70.         return $this->user;
  71.     }
  72.     public function setUser(?User $user): self
  73.     {
  74.         $this->user $user;
  75.         return $this;
  76.     }
  77.     public function getCreatedAt(): ?\DateTimeImmutable
  78.     {
  79.         return $this->createdAt;
  80.     }
  81.     public function setCreatedAt(?\DateTimeImmutable $createdAt): self
  82.     {
  83.         $this->createdAt $createdAt;
  84.         return $this;
  85.     }
  86.     public function getType(): ?string
  87.     {
  88.         return $this->type;
  89.     }
  90.     public function setType(?string $type): self
  91.     {
  92.         $this->type $type;
  93.         return $this;
  94.     }
  95.     public function getBuilding(): ?Building
  96.     {
  97.         return $this->building;
  98.     }
  99.     public function setBuilding(?Building $building): self
  100.     {
  101.         $this->building $building;
  102.         return $this;
  103.     }
  104.     public function getCity(): ?City
  105.     {
  106.         return $this->city;
  107.     }
  108.     public function setCity(?City $city): self
  109.     {
  110.         $this->city $city;
  111.         return $this;
  112.     }
  113.     public function getStreet(): ?string
  114.     {
  115.         return $this->street;
  116.     }
  117.     public function setStreet(?string $street): self
  118.     {
  119.         $this->street $street;
  120.         return $this;
  121.     }
  122.     public function getNumberStreet(): ?string
  123.     {
  124.         return $this->numberStreet;
  125.     }
  126.     public function setNumberStreet(?string $numberStreet): self
  127.     {
  128.         $this->numberStreet $numberStreet;
  129.         return $this;
  130.     }
  131.     public function getPostalCode(): ?string
  132.     {
  133.         return $this->postalCode;
  134.     }
  135.     public function setPostalCode(?string $postalCode): self
  136.     {
  137.         $this->postalCode $postalCode;
  138.         return $this;
  139.     }
  140.     public function getDateStartLease(): ?\DateTimeInterface
  141.     {
  142.         return $this->dateStartLease;
  143.     }
  144.     public function setDateStartLease(?\DateTimeInterface $dateStartLease): self
  145.     {
  146.         $this->dateStartLease $dateStartLease;
  147.         return $this;
  148.     }
  149.     public function getStatusBuilding(): ?string
  150.     {
  151.         return $this->statusBuilding;
  152.     }
  153.     public function setStatusBuilding(?string $statusBuilding): self
  154.     {
  155.         $this->statusBuilding $statusBuilding;
  156.         return $this;
  157.     }
  158.     public function getStatusAnnouncment(): ?string
  159.     {
  160.         return $this->statusAnnouncment;
  161.     }
  162.     public function setStatusAnnouncment(?string $statusAnnouncment): self
  163.     {
  164.         $this->statusAnnouncment $statusAnnouncment;
  165.         return $this;
  166.     }
  167.     public function getNumberId(): ?string
  168.     {
  169.         return $this->numberId;
  170.     }
  171.     public function setNumberId(?string $numberId): self
  172.     {
  173.         $this->numberId $numberId;
  174.         return $this;
  175.     }
  176.     public function getCountry(): ?string
  177.     {
  178.         return $this->country;
  179.     }
  180.     public function setCountry(?string $country): self
  181.     {
  182.         $this->country $country;
  183.         return $this;
  184.     }
  185.     public function getDetail(): ?string
  186.     {
  187.         return $this->detail;
  188.     }
  189.     public function setDetail(?string $detail): self
  190.     {
  191.         $this->detail $detail;
  192.         return $this;
  193.     }
  194.     public function getNumber(): ?string
  195.     {
  196.         return $this->number;
  197.     }
  198.     public function setNumber(?string $number): self
  199.     {
  200.         $this->number $number;
  201.         return $this;
  202.     }
  203. }