← Back
Editing: ElevatorBreakdown.php
<?php namespace App\Entity; use App\Repository\ElevatorBreakdownRepository; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: ElevatorBreakdownRepository::class)] class ElevatorBreakdown { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private ?int $id = null; #[ORM\ManyToOne(targetEntity: Adresse::class, inversedBy: 'elevatorBreakdowns')] #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] private ?Adresse $adresse = null; #[ORM\Column(type: 'datetime')] private \DateTimeInterface $startDate; #[ORM\Column(type: 'datetime', nullable: true)] private ?\DateTimeInterface $endDate = null; #[ORM\OneToOne(mappedBy: 'elevatorBreakdown', targetEntity: Service::class, cascade: ['persist', 'remove'])] private ?Service $service = null; public function __construct() { $this->startDate = new \DateTime(); } public function getId(): ?int { return $this->id; } public function getAdresse(): ?Adresse { return $this->adresse; } public function setAdresse(?Adresse $adresse): self { $this->adresse = $adresse; return $this; } public function getStartDate(): ?\DateTimeInterface { return $this->startDate; } public function setStartDate(\DateTimeInterface $startDate): self { $this->startDate = $startDate; return $this; } public function getEndDate(): ?\DateTimeInterface { return $this->endDate; } public function setEndDate(?\DateTimeInterface $endDate): self { $this->endDate = $endDate; return $this; } public function getService(): ?Service { return $this->service; } public function setService(?Service $service): self { // unset the owning side of the relation if necessary if (null === $service && null !== $this->service) { $this->service->setElevatorBreakdown(null); } // set the owning side of the relation if necessary if (null !== $service && $service->getElevatorBreakdown() !== $this) { $service->setElevatorBreakdown($this); } $this->service = $service; return $this; } }
Save File
Cancel