src/Entity/Parking.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ParkingRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  8. #[ORM\Entity(repositoryClassParkingRepository::class)]
  9. #[HasLifecycleCallbacks]
  10. class Parking
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length45)]
  17.     private ?string $name null;
  18.     #[ORM\Column(length45)]
  19.     private ?string $address null;
  20.     #[ORM\Column(length45)]
  21.     private ?string $phone null;
  22.     #[ORM\Column(length45)]
  23.     private ?string $type null;
  24.     #[ORM\Column(length45)]
  25.     private ?string $vehicle null;
  26.     #[ORM\Column(length45)]
  27.     private ?string $license_plate null;
  28.     #[ORM\Column(length145nullabletrue)]
  29.     private ?string $comment null;
  30.     #[ORM\ManyToMany(targetEntityParkingMatrixRaw::class, mappedBy'owner')]
  31.     private Collection $parkingMatrixRaws;
  32.     public function __construct()
  33.     {
  34.         $this->day = new ArrayCollection();
  35.         $this->parkingMatrixRaws = new ArrayCollection();
  36.     }
  37.     public function __toString()
  38.     {
  39.         return $this->name;
  40.     }
  41.     #[ORM\Column]
  42.     private ?\DateTimeImmutable $createdAt null;
  43.     #[ORM\Column]
  44.     private ?\DateTimeImmutable $updatedAt null;
  45.     #[ORM\Column(nullabletrue)]
  46.     private ?bool $authorized null;
  47.     #[ORM\Column(nullabletrue)]
  48.     private ?bool $usage_concent null;
  49.     #[ORM\Column(nullabletrue)]
  50.     private ?bool $blocked null;
  51.     #[ORM\Column(length120nullabletrue)]
  52.     private ?string $filename null;
  53.     public function getCreatedAt(): ?\DateTimeImmutable
  54.     {
  55.         return $this->createdAt;
  56.     }
  57.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  58.     {
  59.         $this->createdAt $createdAt;
  60.         return $this;
  61.     }
  62.     public function getUpdatedAt(): ?\DateTimeImmutable
  63.     {
  64.         return $this->updatedAt;
  65.     }
  66.     public function setUpdatedAt(\DateTimeImmutable $updatedAt): self
  67.     {
  68.         $this->updatedAt $updatedAt;
  69.         return $this;
  70.     }
  71.     #[ORM\PrePersist]
  72.     public function setCreatedAtValue(): void
  73.     {
  74.         $this->createdAt = new \DateTimeImmutable();
  75.         $this->setUpdatedAtValue();
  76.     }
  77.     #[ORM\PreUpdate]
  78.     public function setUpdatedAtValue(): void
  79.     {
  80.         $this->updatedAt = new \DateTimeImmutable();
  81.     }
  82.     
  83.     public function getId(): ?int
  84.     {
  85.         return $this->id;
  86.     }
  87.     public function getName(): ?string
  88.     {
  89.         return $this->name;
  90.     }
  91.     public function setName(string $name): static
  92.     {
  93.         $this->name $name;
  94.         return $this;
  95.     }
  96.     public function getAddress(): ?string
  97.     {
  98.         return $this->address;
  99.     }
  100.     public function setAddress(string $address): static
  101.     {
  102.         $this->address $address;
  103.         return $this;
  104.     }
  105.     public function getPhone(): ?string
  106.     {
  107.         return $this->phone;
  108.     }
  109.     public function setPhone(string $phone): static
  110.     {
  111.         $this->phone $phone;
  112.         return $this;
  113.     }
  114.     public function getType(): ?string
  115.     {
  116.         return $this->type;
  117.     }
  118.     public function setType(string $type): static
  119.     {
  120.         $this->type $type;
  121.         return $this;
  122.     }
  123.     public function getVehicle(): ?string
  124.     {
  125.         return $this->vehicle;
  126.     }
  127.     public function setVehicle(string $vehicle): static
  128.     {
  129.         $this->vehicle $vehicle;
  130.         return $this;
  131.     }
  132.     public function getLicensePlate(): ?string
  133.     {
  134.         return $this->license_plate;
  135.     }
  136.     public function setLicensePlate(string $license_plate): static
  137.     {
  138.         $this->license_plate $license_plate;
  139.         return $this;
  140.     }
  141.     public function getComment(): ?string
  142.     {
  143.         return $this->comment;
  144.     }
  145.     public function setComment(?string $comment): static
  146.     {
  147.         $this->comment $comment;
  148.         return $this;
  149.     }
  150.     /**
  151.      * @return Collection<int, ParkingMatrixRaw>
  152.      */
  153.     public function getParkingMatrixRaws(): Collection
  154.     {
  155.         return $this->parkingMatrixRaws;
  156.     }
  157.     public function addParkingMatrixRaw(ParkingMatrixRaw $parkingMatrixRaw): static
  158.     {
  159.         if (!$this->parkingMatrixRaws->contains($parkingMatrixRaw)) {
  160.             $this->parkingMatrixRaws->add($parkingMatrixRaw);
  161.             $parkingMatrixRaw->addOwner($this);
  162.         }
  163.         return $this;
  164.     }
  165.     public function removeParkingMatrixRaw(ParkingMatrixRaw $parkingMatrixRaw): static
  166.     {
  167.         if ($this->parkingMatrixRaws->removeElement($parkingMatrixRaw)) {
  168.             $parkingMatrixRaw->removeOwner($this);
  169.         }
  170.         return $this;
  171.     }
  172.     public function isAuthorized(): ?bool
  173.     {
  174.         return $this->authorized;
  175.     }
  176.     public function setAuthorized(?bool $authorized): static
  177.     {
  178.         $this->authorized $authorized;
  179.         return $this;
  180.     }
  181.     public function isUsageConcent(): ?bool
  182.     {
  183.         return $this->usage_concent;
  184.     }
  185.     public function setUsageConcent(?bool $usage_concent): static
  186.     {
  187.         $this->usage_concent $usage_concent;
  188.         return $this;
  189.     }
  190.     public function isBlocked(): ?bool
  191.     {
  192.         return $this->blocked;
  193.     }
  194.     public function setBlocked(?bool $blocked): static
  195.     {
  196.         $this->blocked $blocked;
  197.         return $this;
  198.     }
  199.     public function getFilename(): ?string
  200.     {
  201.         return $this->filename;
  202.     }
  203.     public function setFilename(?string $filename): static
  204.     {
  205.         $this->filename $filename;
  206.         return $this;
  207.     }
  208. }