← Back
Editing: Report.php
<?php declare(strict_types=1); namespace App\Entity; use App\Enum\ReportStatusType; use App\Enum\ReportType; use App\Repository\ReportRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; #[ORM\Entity(repositoryClass: ReportRepository::class)] class Report { #[Groups(['show_report', 'export_report'])] #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(type: Types::TEXT)] private ?string $location = null; #[Groups(['show_report'])] #[ORM\Column] private ?float $lat = null; #[Groups(['show_report'])] #[ORM\Column] private ?float $lng = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $comment = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(length: 45, nullable: true)] private ?string $registration = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(nullable: true)] private ?bool $alertManager = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(nullable: true)] private ?bool $sendCopy = null; #[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'reports')] #[ORM\JoinColumn(name: 'agent_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')] private ?User $agent = null; #[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'managerReports')] #[ORM\JoinColumn(name: 'manager_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')] private ?User $manager = null; /** * @var Collection<array-key, ReportPicture> */ #[Groups(['show_report'])] #[ORM\JoinTable(name: 'report_report_picture')] #[ORM\JoinColumn(name: 'report_id', referencedColumnName: 'id', onDelete: 'CASCADE')] #[ORM\InverseJoinColumn(name: 'picture_id', referencedColumnName: 'id')] #[ORM\ManyToMany(targetEntity: ReportPicture::class, inversedBy: 'reports', cascade: ['persist'])] private Collection $reportPictures; #[Groups(['show_report', 'export_report'])] #[ORM\Column(type: 'string', length: 30, enumType: ReportType::class)] private ?ReportType $type = null; #[Groups(['show_report', 'export_report'])] #[ORM\ManyToOne(inversedBy: 'reports')] #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] private ?ReportItem $reportItem = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(type: Types::DATETIME_MUTABLE)] private \DateTimeInterface $createdAt; #[Groups(['show_report'])] #[ORM\Column(type: 'string', length: 30, enumType: ReportStatusType::class, options: ['default' => ReportStatusType::REPORT_STATUS_INCOMING])] private ReportStatusType $status = ReportStatusType::REPORT_STATUS_INCOMING; #[Groups(['show_report'])] #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $confirmedAt = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(length: 255, nullable: true)] private ?string $carType = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(length: 255, nullable: true)] private ?string $carBrand = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(length: 255, nullable: true)] private ?string $carColor = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column(length: 255, nullable: true)] private ?string $insuranceNumber = null; #[Groups(['show_report', 'export_report'])] #[ORM\Column] private ?bool $isRegistrationUnavailable = false; #[Groups(['show_report'])] #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $closedAt = null; #[Groups(['show_report'])] #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $generatedAt = null; #[ORM\OneToMany(mappedBy: 'report', targetEntity: ReportMail::class)] private Collection $reportMails; public function __construct() { $this->createdAt = new \DateTime(); $this->reportPictures = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getLocation(): ?string { return $this->location; } public function setLocation(string $location): self { $this->location = $location; return $this; } public function getLat(): ?float { return $this->lat; } public function setLat(float $lat): self { $this->lat = $lat; return $this; } public function getLng(): ?float { return $this->lng; } public function setLng(float $lng): self { $this->lng = $lng; return $this; } public function getComment(): ?string { return $this->comment; } public function setComment(?string $comment): self { $this->comment = $comment; return $this; } public function getRegistration(): ?string { return $this->registration; } public function setRegistration(?string $registration): self { $this->registration = $registration; return $this; } public function isAlertManager(): ?bool { return $this->alertManager; } public function setAlertManager(?bool $alertManager): self { $this->alertManager = $alertManager; return $this; } public function isSendCopy(): ?bool { return $this->sendCopy; } public function setSendCopy(?bool $sendCopy): self { $this->sendCopy = $sendCopy; return $this; } public function getAgent(): ?User { return $this->agent; } public function setAgent(?User $agent): self { $this->agent = $agent; return $this; } public function getManager(): ?User { return $this->manager; } public function setManager(?User $manager): self { $this->manager = $manager; return $this; } /** * @return Collection<array-key, ReportPicture> */ public function getReportPictures(): Collection { return $this->reportPictures; } /** * @return $this */ public function addReportPicture(ReportPicture $reportPicture): self { if (!$this->reportPictures->contains($reportPicture)) { $this->reportPictures[] = $reportPicture; } return $this; } public function removeReportPicture(ReportPicture $reportPicture): self { if ($this->reportPictures->contains($reportPicture)) { $this->reportPictures->removeElement($reportPicture); } return $this; } public function getType(): ?ReportType { return $this->type; } public function setType(ReportType $type): self { $this->type = $type; return $this; } public function getReportItem(): ?ReportItem { return $this->reportItem; } public function setReportItem(?ReportItem $reportItem): self { $this->reportItem = $reportItem; return $this; } public function getStatus(): ReportStatusType { return $this->status; } public function setStatus(ReportStatusType $status): self { $this->status = $status; return $this; } public function getCreatedAt(): \DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getConfirmedAt(): ?\DateTimeInterface { return $this->confirmedAt; } public function setConfirmedAt(?\DateTimeInterface $confirmedAt): self { $this->confirmedAt = $confirmedAt; return $this; } public function getCarType(): ?string { return $this->carType; } public function setCarType(?string $carType): self { $this->carType = $carType; return $this; } public function getCarBrand(): ?string { return $this->carBrand; } public function setCarBrand(?string $carBrand): self { $this->carBrand = $carBrand; return $this; } public function getCarColor(): ?string { return $this->carColor; } public function setCarColor(?string $carColor): self { $this->carColor = $carColor; return $this; } public function isIsRegistrationUnavailable(): ?bool { return $this->isRegistrationUnavailable; } public function setIsRegistrationUnavailable(bool $isRegistrationUnavailable): self { $this->isRegistrationUnavailable = $isRegistrationUnavailable; return $this; } public function getClosedAt(): ?\DateTimeInterface { return $this->closedAt; } public function setClosedAt(?\DateTimeInterface $closedAt): self { $this->closedAt = $closedAt; return $this; } public function getGeneratedAt(): ?\DateTimeInterface { return $this->generatedAt; } public function setGeneratedAt(?\DateTimeInterface $generatedAt): self { $this->generatedAt = $generatedAt; return $this; } public function getInsuranceNumber(): ?string { return $this->insuranceNumber; } public function setInsuranceNumber(?string $insuranceNumber): self { $this->insuranceNumber = $insuranceNumber; return $this; } /** * @return Collection<int, ReportMail> */ public function getReportMails(): Collection { return $this->reportMails; } public function addReportMail(ReportMail $reportMail): static { if (!$this->reportMails->contains($reportMail)) { $this->reportMails->add($reportMail); $reportMail->setReport($this); } return $this; } public function removeServiceMail(ReportMail $reportMail): static { if ($this->reportMails->removeElement($reportMail)) { // set the owning side to null (unless already changed) if ($reportMail->getReport() === $this) { $reportMail->setReport(null); } } return $this; } }
Save File
Cancel