src/Entity/ChannelUserData/AdminChannelUserData/AdminDriveFile.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\ChannelUserData\AdminChannelUserData;
  3. use App\Entity\ChannelUserData\AdminChannelUserData;
  4. use App\Entity\Common\File;
  5. use App\Repository\ChannelUserData\AdminChannelUserData\AdminDriveFileRepository;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints\NotBlank;
  8. use Symfony\Component\Serializer\Annotation as Serial;
  9. #[
  10. ORM\Entity(repositoryClass: AdminDriveFileRepository::class),
  11. ORM\Table('file_admin_channel_user_data_drive')
  12. ]
  13. class AdminDriveFile extends File
  14. {
  15. #[ORM\ManyToOne(targetEntity: AdminChannelUserData::class)]
  16. #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
  17. private ?AdminChannelUserData $channelUserData = null;
  18. #[ORM\Column(type: 'date', nullable: true)]
  19. #[
  20. NotBlank(groups: ['ToRemoveAt']),
  21. ]
  22. #[Serial\Groups(['ToRemoveAt', 'Manager'])]
  23. private ?\DateTime $toRemoveAt = null;
  24. #[ORM\Column(type: 'boolean', nullable: false)]
  25. #[Serial\Groups(['PostFile', 'PutFile', 'Manager'])]
  26. private bool $share = true;
  27. public static function getFileSystemAlias(): string
  28. {
  29. return 'admin_channel_user_data_drive_filesystem';
  30. }
  31. public static function getUploaderAlias(): ?string
  32. {
  33. return 'admin_channel_user_data_drive_upload';
  34. }
  35. public function getChannelUserData(): ?AdminChannelUserData
  36. {
  37. return $this->channelUserData;
  38. }
  39. public function setChannelUserData(?AdminChannelUserData $channelUserData): static
  40. {
  41. $this->channelUserData = $channelUserData;
  42. return $this;
  43. }
  44. public function getToRemoveAt(): ?\DateTime
  45. {
  46. return $this->toRemoveAt;
  47. }
  48. public function setToRemoveAt(?\DateTime $toRemoveAt): static
  49. {
  50. $this->toRemoveAt = $toRemoveAt;
  51. return $this;
  52. }
  53. public function isShare(): bool
  54. {
  55. return $this->share;
  56. }
  57. public function setShare(bool $share): AdminDriveFile
  58. {
  59. $this->share = $share;
  60. return $this;
  61. }
  62. }