src/Entity/Channel/Export/FileExport.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Channel\Export;
  3. use App\Entity\Channel\Channel;
  4. use App\Entity\Common\File;
  5. use App\Enum\Channel\FileExportStatusEnum;
  6. use App\Repository\Channel\Export\FileExportRepository;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Doctrine\ORM\Mapping\JoinColumn;
  9. use Doctrine\ORM\Mapping\ManyToOne;
  10. #[
  11.     ORM\Entity(repositoryClassFileExportRepository::class),
  12.     ORM\Table(name'file_channel_export'),
  13. ]
  14. class FileExport extends File
  15. {
  16.     const TAG_CURSUS 'cursus';
  17.     const TAG_FORMERS 'formers';
  18.     const TAG_ADMINS 'admins';
  19.     const TAG_COMPANIES 'companies';
  20.     const TAG_CONTACTS 'contacts';
  21.     #[ManyToOne(targetEntityChannel::class, fetch'EAGER')]
  22.     #[JoinColumn(nullabletrueonDelete'CASCADE')]
  23.     private ?Channel $channel null;
  24.     #[ORM\Column(type'string'length255)]
  25.     private string $status FileExportStatusEnum::STATUS_PENDING;
  26.     #[ORM\Column(type'simple_array'nullablefalse)]
  27.     private array $payload = [];
  28.     #[ORM\Column(type'json'nullabletrue)]
  29.     private ?array $options null;
  30.     #[ORM\Column(type'integer'nullablefalse)]
  31.     private int $prepared 0;
  32.     #[ORM\Column(type'string'length255nullablefalse)]
  33.     private ?string $tag null;
  34.     public static function getFileSystemAlias(): string
  35.     {
  36.         return 'export_filesystem';
  37.     }
  38.     public static function getUploaderAlias(): ?string
  39.     {
  40.         return null;
  41.     }
  42.     public function incrementPrepared(): void
  43.     {
  44.         $this->prepared++;
  45.     }
  46.     public function isReady(): bool
  47.     {
  48.         return $this->prepared >= count($this->payload);
  49.     }
  50.     public function getChannel(): ?Channel
  51.     {
  52.         return $this->channel;
  53.     }
  54.     public function setChannel(?Channel $channel): FileExport
  55.     {
  56.         $this->channel $channel;
  57.         return $this;
  58.     }
  59.     public function getStatus(): string
  60.     {
  61.         return $this->status;
  62.     }
  63.     public function setStatus(string $status): FileExport
  64.     {
  65.         $this->status $status;
  66.         return $this;
  67.     }
  68.     public function getPayload(): array
  69.     {
  70.         return $this->payload;
  71.     }
  72.     public function setPayload(array $payload): FileExport
  73.     {
  74.         $this->payload $payload;
  75.         return $this;
  76.     }
  77.     public function getPrepared(): int
  78.     {
  79.         return $this->prepared;
  80.     }
  81.     public function setPrepared(int $prepared): FileExport
  82.     {
  83.         $this->prepared $prepared;
  84.         return $this;
  85.     }
  86.     public function getTag(): ?string
  87.     {
  88.         return $this->tag;
  89.     }
  90.     public function setTag(?string $tag): FileExport
  91.     {
  92.         $this->tag $tag;
  93.         return $this;
  94.     }
  95.     public function getOptions(): ?array
  96.     {
  97.         return $this->options;
  98.     }
  99.     public function setOptions(?array $options): FileExport
  100.     {
  101.         $this->options $options;
  102.         return $this;
  103.     }
  104. }