← Back
Editing: ReportPicture.php
<?php declare(strict_types=1); namespace App\Entity; use App\Repository\ReportPictureRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Annotation\Groups; #[ORM\Entity(repositoryClass: ReportPictureRepository::class)] class ReportPicture { #[Groups(['show_report_picture', 'show_report'])] #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private ?int $id = null; #[Groups(['show_report_picture', 'show_report'])] #[ORM\Column(type: 'string', length: 255)] private ?string $path = null; #[Groups(['show_report_picture', 'show_report'])] #[ORM\Column(length: 255, nullable: true)] private ?string $resizedPath = null; #[Groups(['show_report_picture', 'show_report'])] #[ORM\Column(type: 'integer')] private int $size; #[Groups(['show_report_picture', 'show_report'])] #[ORM\Column(type: 'integer')] private int $width; #[Groups(['show_report_picture', 'show_report'])] #[ORM\Column(type: 'integer')] private int $height; #[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'reportPictures')] #[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')] private ?User $owner = null; #[ORM\ManyToMany(targetEntity: Report::class, mappedBy: 'reportPictures')] private Collection $reports; public function __construct() { $this->reports = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getPath(): ?string { return $this->path; } public function setPath(string $path): self { $this->path = $path; return $this; } public function getResizedPath(): ?string { return $this->resizedPath; } public function setResizedPath(?string $resizedPath): self { $this->resizedPath = $resizedPath; return $this; } public function getSize(): ?int { return $this->size; } public function setSize(int $size): self { $this->size = $size; return $this; } public function getWidth(): ?int { return $this->width; } public function setWidth(int $width): self { $this->width = $width; return $this; } public function getHeight(): ?int { return $this->height; } public function setHeight(int $height): self { $this->height = $height; return $this; } public function getOwner(): ?User { return $this->owner; } public function setOwner(?User $owner): self { $this->owner = $owner; return $this; } public function getReports(): ?Collection { return $this->reports; } public function addReport(Report $report): self { if (!$this->reports->contains($report)) { $this->reports[] = $report; $report->addReportPicture($this); } return $this; } public function removeReportReport(Report $report): self { if ($this->reports->contains($report)) { $this->reports->removeElement($report); $report->addReportPicture($this); } return $this; } }
Save File
Cancel