src/Entity/Channel/FileOrganization.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Channel;
  3. use App\Entity\Common\File;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Symfony\Component\Serializer\Annotation as Serial;
  7. #[
  8. ORM\Entity(),
  9. ORM\Table('file_organization',)
  10. ]
  11. class FileOrganization extends File
  12. {
  13. #[ORM\ManyToOne(targetEntity: Organization::class, inversedBy: 'files')]
  14. #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
  15. private ?Organization $organization = null;
  16. #[ORM\Column(type: 'string', nullable: false)]
  17. #[Assert\NotBlank]
  18. #[Serial\Groups(['Manager'])]
  19. private ?string $tag = null;
  20. public static function getFileSystemAlias(): string
  21. {
  22. return 'organization_filesystem';
  23. }
  24. public static function getUploaderAlias(): ?string
  25. {
  26. return 'organization_upload';
  27. }
  28. public function getOrganization(): ?Organization
  29. {
  30. return $this->organization;
  31. }
  32. public function setOrganization(?Organization $organization): static
  33. {
  34. $this->organization = $organization;
  35. return $this;
  36. }
  37. public function getTag(): ?string
  38. {
  39. return $this->tag;
  40. }
  41. public function setTag(?string $tag): static
  42. {
  43. $this->tag = $tag;
  44. return $this;
  45. }
  46. }