src/Entity/Profile/Confirmation/MediaFile.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Profile\Confirmation;
  3. use App\Entity\IMediaFile;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Table(name'profile_confirmation_requests_media_files')]
  6. #[ORM\Entity]
  7. #[ORM\InheritanceType('SINGLE_TABLE')]
  8. #[ORM\DiscriminatorColumn(name'type'type'string'length12)]
  9. #[ORM\DiscriminatorMap(['photo' => Photo::class, 'video' => Video::class])]
  10. abstract class MediaFile implements IMediaFile
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\Column(name'id'type'integer')]
  14.     #[ORM\GeneratedValue(strategy'AUTO')]
  15.     protected int $id;
  16.     #[ORM\JoinColumn(name'confirmation_request_id'referencedColumnName'id')]
  17.     #[ORM\ManyToOne(targetEntityConfirmationRequest::class, inversedBy'photos')]
  18.     protected ConfirmationRequest $confirmationRequest;
  19.     #[ORM\Column(name'path'type'string'length128)]
  20.     protected string $path;
  21.     #[ORM\Column(name'preview_path'type'string'length128nullabletrue)]
  22.     protected ?string $previewPath null;
  23.     public function __construct(ConfirmationRequest $confirmationRequeststring $path)
  24.     {
  25.         $this->confirmationRequest $confirmationRequest;
  26.         $this->path $path;
  27.     }
  28.     public function getId(): int
  29.     {
  30.         return $this->id;
  31.     }
  32.     public function getPath(): string
  33.     {
  34.         return $this->path;
  35.     }
  36.     public function setPath(string $path): void
  37.     {
  38.         $this->path $path;
  39.     }
  40.     public function getPreviewPath(): ?string
  41.     {
  42.         return $this->previewPath;
  43.     }
  44.     public function setPreviewPath(?string $previewPath): void
  45.     {
  46.         $this->previewPath $previewPath;
  47.     }
  48. }