src/Entity/Library.php line 445

Open in your IDE?
  1. <?php
  2. namespace EADPlataforma\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use EADPlataforma\Validator\Constraints as EADAssert;
  7. use EADPlataforma\Enum\LibraryEnum;
  8. use EADPlataforma\Util\StringUtil;
  9. use \DateTime;
  10. /**
  11.  * Library
  12.  *
  13.  * @ORM\Table(name="library", indexes={
  14.  *      @ORM\Index(name="fk_library_user_id", columns={"user_id"}),
  15.  *      @ORM\Index(name="fk_library_user_delete_id", columns={"user_delete_id"})
  16.  * })
  17.  *
  18.  * @ORM\Entity(repositoryClass="EADPlataforma\Repository\LibraryRepository")
  19.  */
  20. class Library
  21. {
  22.     /**
  23.      * @var int
  24.      *
  25.      * @ORM\Column(name="id", type="integer", nullable=false)
  26.      * @ORM\Id
  27.      * @ORM\GeneratedValue(strategy="IDENTITY")
  28.      */
  29.     private $id;
  30.     /**
  31.      * @Assert\NotBlank(
  32.      *      message = "Deleted not informed"
  33.      * )
  34.      *
  35.      * @Assert\Choice(
  36.      *      choices = { 
  37.      *                      LibraryEnum::ITEM_NO_DELETED, 
  38.      *                      LibraryEnum::ITEM_ON_TRASH,
  39.      *                      LibraryEnum::ITEM_DELETED
  40.      *                },
  41.      *      message = "Delete Option Invalid"
  42.      * )
  43.      *
  44.      * @var int
  45.      *
  46.      * @ORM\Column(name="deleted", type="integer", nullable=false, options={"default"="0"})
  47.      */
  48.     private $deleted LibraryEnum::ITEM_NO_DELETED;
  49.     /**
  50.      * @Assert\NotBlank(
  51.      *    message = "Title not informed"
  52.      * )
  53.      * 
  54.      * @Assert\Length(
  55.      *      min = 0,
  56.      *      max = 145
  57.      * )
  58.      *
  59.      * @var string
  60.      *
  61.      * @ORM\Column(name="title", type="string", length=150, nullable=false)
  62.      */
  63.     private $title;
  64.     /**
  65.      * @Assert\NotBlank(
  66.      *    message = "Status not informed"
  67.      * )
  68.      *
  69.      * @Assert\Choice(
  70.      *      choices = { LibraryEnum::DRAFT, LibraryEnum::PUBLISHED },
  71.      *      message = "Status Invalid"
  72.      * )
  73.      *
  74.      * @var int
  75.      *
  76.      * @ORM\Column(name="status", type="integer", nullable=false, options={"default"="0"})
  77.      */
  78.     private $status LibraryEnum::DRAFT;
  79.     /**
  80.      * @Assert\NotBlank(
  81.      *    message = "Origin not informed"
  82.      * )
  83.      *
  84.      * @Assert\Choice(
  85.      *      choices = { 
  86.      *                      LibraryEnum::LESSON,
  87.      *                      LibraryEnum::LESSON_DOWNLOAD,
  88.      *                      LibraryEnum::QUESTION,
  89.      *                      LibraryEnum::LIBRARY
  90.      *                },
  91.      *      message = "Origin Invalid"
  92.      * )
  93.      *
  94.      * @var int
  95.      *
  96.      * @ORM\Column(name="origin", type="integer", nullable=false)
  97.      */
  98.     private $origin;
  99.     /**
  100.      * @Assert\NotBlank(
  101.      *    message = "Download number not informed"
  102.      * )
  103.      *
  104.      * @var int
  105.      *
  106.      * @ORM\Column(name="download_number", type="integer", nullable=false, options={"default"="0"})
  107.      */
  108.     private $downloadNumber 0;
  109.     /**
  110.      * @Assert\Choice(
  111.      *      choices = { 
  112.      *                      LibraryEnum::CONTENT_EMBED,
  113.      *                      LibraryEnum::CONTENT_FILES,
  114.      *                      LibraryEnum::CONTENT_AUDIO,
  115.      *                      LibraryEnum::CONTENT_TEXT,
  116.      *                      LibraryEnum::CONTENT_VIDEO,
  117.      *                      LibraryEnum::CONTENT_LIVE,
  118.      *                      LibraryEnum::CONTENT_CONFERENCE,
  119.      *                      LibraryEnum::CONTENT_VIDEO_FILE,
  120.      *                      LibraryEnum::CONTENT_EXTERNAL_LIVE,
  121.      *                },
  122.      *      message = "Type Invalid"
  123.      * )
  124.      *
  125.      * @var int
  126.      *
  127.      * @ORM\Column(name="type", type="integer", nullable=true)
  128.      */
  129.     private $type;
  130.     /**
  131.      * @Assert\NotBlank(
  132.      *      message = "Link not informed",
  133.      *      groups  = "linkType"
  134.      * )
  135.      * 
  136.      * @Assert\Length(
  137.      *      min = 0,
  138.      *      max = 250
  139.      * )
  140.      *
  141.      * @var string|null
  142.      *
  143.      * @ORM\Column(name="link", type="string", length=255, nullable=true)
  144.      */
  145.     private $link;
  146.     /**
  147.      * @Assert\NotBlank(
  148.      *      message = "Text not informed",
  149.      *      groups  = "textType"
  150.      * )
  151.      *
  152.      * @var string|null
  153.      *
  154.      * @ORM\Column(name="text", type="text", length=0, nullable=true)
  155.      */
  156.     private $text;
  157.     /**
  158.      * @Assert\File(
  159.      *     maxSize = "4000M",
  160.      *     maxSizeMessage = "File is to large",
  161.      *     groups  = "fileType"
  162.      * )
  163.      */
  164.     protected $file;
  165.     /**
  166.      * @Assert\NotBlank(
  167.      *      message = "File not informed",
  168.      *      groups  = "fileType"
  169.      * )
  170.      * 
  171.      * @Assert\Length(
  172.      *      min = 0,
  173.      *      max = 250
  174.      * )
  175.      *
  176.      * @var string|null
  177.      *
  178.      * @ORM\Column(name="file", type="string", length=255, nullable=true)
  179.      */
  180.     private $fileName;
  181.     /**
  182.      * @Assert\NotBlank(
  183.      *      message = "File Size informed",
  184.      *      groups  = "fileType"
  185.      * )
  186.      *
  187.      * @var int|null
  188.      *
  189.      * @ORM\Column(name="file_size", type="integer", nullable=true)
  190.      */
  191.     private $fileSize;
  192.     /**
  193.      * @Assert\NotBlank(
  194.      *      message = "File Extension not informed",
  195.      *      groups  = "fileType"
  196.      * )
  197.      *
  198.      * @var string|null
  199.      *
  200.      * @ORM\Column(name="file_extension", type="string", length=5, nullable=true, options={"fixed"=true})
  201.      */
  202.     private $fileExtension;
  203.     /**
  204.      * @Assert\NotBlank(
  205.      *      message = "Vimeo Id not informed",
  206.      *      groups  = "vimeoFileType"
  207.      * )
  208.      *
  209.      * @var int|null
  210.      *
  211.      * @ORM\Column(name="vimeo_id", type="integer", nullable=true)
  212.      */
  213.     private $vimeoId;
  214.     /**
  215.      * @Assert\NotBlank(
  216.      *      message = "Vdocipher Id not informed",
  217.      *      groups  = "vimeoFileType"
  218.      * )
  219.      *
  220.      * @var string|null
  221.      *
  222.      * @ORM\Column(name="vimeo_video_id", type="string", length=255, nullable=true)
  223.      */
  224.     private $vimeoVideoId;
  225.     /**
  226.      * @Assert\NotBlank(
  227.      *      message = "Vdocipher Id not informed",
  228.      *      groups  = "videFileType"
  229.      * )
  230.      *
  231.      * @var string|null
  232.      *
  233.      * @ORM\Column(name="vdocipher_video_id", type="string", length=255, nullable=true)
  234.      */
  235.     private $vdocipherVideoId;
  236.     /**
  237.      * @var int|null
  238.      *
  239.      * @ORM\Column(name="pages_number", type="integer", nullable=true)
  240.      */
  241.     private $pagesNumber;
  242.     /**
  243.      * @var string|null
  244.      *
  245.      * @ORM\Column(name="duration", type="string", length=10, nullable=true)
  246.      */
  247.     private $duration;
  248.     /**
  249.      * @EADAssert\DateTimeEAD(
  250.      *      message = "Live Start Invalid",
  251.      *      groups  = "liveType"
  252.      * )
  253.      *
  254.      * @var \DateTime|null
  255.      *
  256.      * @ORM\Column(name="live_start", type="datetime", nullable=true)
  257.      */
  258.     private $liveStart;
  259.     /**
  260.      * @Assert\Length(
  261.      *      min = 0,
  262.      *      max = 250
  263.      * )
  264.      * 
  265.      * @var string|null
  266.      *
  267.      * @ORM\Column(name="live_cover", type="string", length=255, nullable=true)
  268.      */
  269.     private $liveCover;
  270.     /**
  271.      * @Assert\NotBlank(
  272.      *      message = "Live Link Transmit Invalid",
  273.      *      groups  = "liveType"
  274.      * )
  275.      *
  276.      * @var string|null
  277.      *
  278.      * @ORM\Column(name="live_link_transmit", type="string", length=255, nullable=true)
  279.      */
  280.     private $liveLinkTransmit;
  281.     /**
  282.      * @Assert\NotBlank(
  283.      *      message = "Live Link Invalid",
  284.      *      groups  = "liveType"
  285.      * )
  286.      *
  287.      * @var string|null
  288.      *
  289.      * @ORM\Column(name="live_link", type="string", length=255, nullable=true)
  290.      */
  291.     private $liveLink;
  292.     /**
  293.      * @Assert\NotBlank(
  294.      *      message = "Live Token Invalid",
  295.      *      groups  = "liveType"
  296.      * )
  297.      *
  298.      * @var string|null
  299.      *
  300.      * @ORM\Column(name="live_token", type="string", length=45, nullable=true)
  301.      */
  302.     private $liveToken;
  303.     /**
  304.      * @Assert\NotBlank(
  305.      *      message = "Live Id Event Invalid",
  306.      *      groups  = "liveType"
  307.      * )
  308.      *
  309.      * @var string|null
  310.      *
  311.      * @ORM\Column(name="live_id_event", type="string", length=45, nullable=true)
  312.      */
  313.     private $liveIdEvent;
  314.     /**
  315.      * @Assert\NotBlank(
  316.      *    message = "Show Live Viewer Number not informed"
  317.      * )
  318.      *
  319.      * @Assert\Choice(
  320.      *      choices = { LibraryEnum::NO, LibraryEnum::YES },
  321.      *      message = "Show Live Viewer Number Invalid"
  322.      * )
  323.      *
  324.      * @var int
  325.      *
  326.      * @ORM\Column(name="show_live_viewer_number", type="integer", nullable=false, options={"default"="0"})
  327.      */
  328.     private $showLiveViewerNumber LibraryEnum::NO;
  329.     /**
  330.      * @Assert\NotBlank(
  331.      *    message = "Show Text Pdf not informed"
  332.      * )
  333.      *
  334.      * @Assert\Choice(
  335.      *      choices = { LibraryEnum::NO, LibraryEnum::YES },
  336.      *      message = "Show Text Pdf Invalid"
  337.      * )
  338.      *
  339.      * @var int
  340.      *
  341.      * @ORM\Column(name="show_text_pdf", type="integer", nullable=false, options={"default"="0"})
  342.      */
  343.     private $showTextPdf LibraryEnum::NO;
  344.     /**
  345.      * 
  346.      * @Assert\Choice(
  347.      *      choices = { LibraryEnum::SVG_OFF, LibraryEnum::SVG_ON },
  348.      *      message = "PDF Svg Mode invalid"
  349.      * )
  350.      *
  351.      * @var int
  352.      *
  353.      * @ORM\Column(name="pdf_svg_mode", type="integer", nullable=false, options={"default"="1"})
  354.      */
  355.     private $pdfSvgMode LibraryEnum::SVG_OFF;
  356.     /**
  357.      * @Assert\NotBlank(
  358.      *    message = "User not informed"
  359.      * )
  360.      * 
  361.      * @Assert\Valid
  362.      *
  363.      * @var \User
  364.      *
  365.      * @ORM\ManyToOne(targetEntity="User")
  366.      * @ORM\JoinColumns({
  367.      *   @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
  368.      * })
  369.      */
  370.     private $user;
  371.     /**
  372.      * @Assert\Valid
  373.      *
  374.      * @var \EADPlataforma\Entity\User
  375.      *
  376.      * @ORM\ManyToOne(targetEntity="User")
  377.      * @ORM\JoinColumns({
  378.      *   @ORM\JoinColumn(name="user_delete_id", referencedColumnName="id", nullable=true)
  379.      * })
  380.      */
  381.     private $userDelete;
  382.     /**
  383.      * @Assert\Choice(
  384.      *      choices = { 
  385.      *                      LibraryEnum::INDIVIDUAL, 
  386.      *                      LibraryEnum::CASCADE
  387.      *                },
  388.      *      message = "Type Delete Invalid"
  389.      * )
  390.      *
  391.      * @var int
  392.      *
  393.      * @ORM\Column(name="type_delete", type="integer", nullable=true)
  394.      */
  395.     private $typeDelete;
  396.     /**
  397.      * @EADAssert\DateTimeEAD(
  398.      *      message = "Date Delete Invalid"
  399.      * )
  400.      *
  401.      * @var \DateTime|null
  402.      *
  403.      * @ORM\Column(name="date_delete", type="datetime", nullable=true)
  404.      */
  405.     private $dateDelete;
  406.     public function getId(): ?int
  407.     {
  408.         return $this->id;
  409.     }
  410.     public function getTitle(): ?string
  411.     {
  412.         return StringUtil::fromUnicode(StringUtil::encodeStringStatic($this->title));
  413.     }
  414.     public function setTitle(string $title): self
  415.     {
  416.         $this->title StringUtil::toUnicode($title);
  417.         return $this;
  418.     }
  419.     public function getStatus(): ?int
  420.     {
  421.         return $this->status;
  422.     }
  423.     public function setStatus(int $status): self
  424.     {
  425.         $this->status $status;
  426.         return $this;
  427.     }
  428.     public function getOrigin(): ?int
  429.     {
  430.         return $this->origin;
  431.     }
  432.     public function setOrigin(int $origin): self
  433.     {
  434.         $this->origin $origin;
  435.         return $this;
  436.     }
  437.     public function getDownloadNumber(): ?int
  438.     {
  439.         return $this->downloadNumber;
  440.     }
  441.     public function setDownloadNumber(int $downloadNumber): self
  442.     {
  443.         $this->downloadNumber $downloadNumber;
  444.         return $this;
  445.     }
  446.     public function getType($string false)
  447.     {
  448.         if($string){
  449.             return $this->stringType($this->type);
  450.         }
  451.         return $this->type;
  452.     }
  453.     public function setType(?int $type): self
  454.     {
  455.         $this->type $type;
  456.         return $this;
  457.     }
  458.     public function getLink(): ?string
  459.     {
  460.         return html_entity_decode($this->link);
  461.     }
  462.     public function setLink(?string $link): self
  463.     {
  464.         $this->link $link;
  465.         return $this;
  466.     }
  467.     public function getText(): ?string
  468.     {
  469.         return StringUtil::fromUnicode(StringUtil::encodeStringStatic($this->text));
  470.     }
  471.     public function setText(?string $text): self
  472.     {
  473.         $this->text StringUtil::toUnicode($text);
  474.         return $this;
  475.     }
  476.     public function setFile($file): self
  477.     {
  478.         $this->file $file;
  479.         return $this;
  480.     }
  481.     public function getFile()
  482.     {
  483.         return $this->file;
  484.     }
  485.     public function getFileName(): ?string
  486.     {
  487.         return StringUtil::encodeStringStatic($this->fileName);
  488.     }
  489.     public function setFileName(?string $fileName): self
  490.     {
  491.         $this->fileName $fileName;
  492.         return $this;
  493.     }
  494.     public function getFileSize(): ?int
  495.     {
  496.         return $this->fileSize;
  497.     }
  498.     public function setFileSize(?int $fileSize): self
  499.     {
  500.         $this->fileSize $fileSize;
  501.         return $this;
  502.     }
  503.     public function getFileExtension(): ?string
  504.     {
  505.         return $this->fileExtension;
  506.     }
  507.     public function setFileExtension(?string $fileExtension): self
  508.     {
  509.         $this->fileExtension $fileExtension;
  510.         return $this;
  511.     }
  512.     public function getVimeoId(): ?int
  513.     {
  514.         return $this->vimeoId;
  515.     }
  516.     public function setVimeoId(?int $vimeoId): self
  517.     {
  518.         $this->vimeoId $vimeoId;
  519.         return $this;
  520.     }
  521.     public function getVimeoVideoId(): ?string
  522.     {
  523.         return $this->vimeoVideoId;
  524.     }
  525.     public function setVimeoVideoId(?string $vimeoVideoId): self
  526.     {
  527.         $this->vimeoVideoId $vimeoVideoId;
  528.         return $this;
  529.     }
  530.     public function getVdocipherVideoId(): ?string
  531.     {
  532.         return $this->vdocipherVideoId;
  533.     }
  534.     public function setVdocipherVideoId(?string $vdocipherVideoId): self
  535.     {
  536.         $this->vdocipherVideoId $vdocipherVideoId;
  537.         return $this;
  538.     }
  539.     public function getPagesNumber(): ?int
  540.     {
  541.         return $this->pagesNumber;
  542.     }
  543.     public function setPagesNumber(?int $pagesNumber): self
  544.     {
  545.         $this->pagesNumber $pagesNumber;
  546.         return $this;
  547.     }
  548.     public function getDuration(): ?string
  549.     {
  550.         return $this->duration;
  551.     }
  552.     public function setDuration(?string $duration): self
  553.     {   
  554.         $this->duration $duration;
  555.         
  556.         return $this;
  557.     }
  558.     public function getLiveStart($dateFormat 'Y-m-d H:i:s')
  559.     {
  560.         if($this->liveStart){
  561.             return $this->liveStart->format($dateFormat);
  562.         }
  563.         return $this->liveStart;
  564.     }
  565.     public function setLiveStart($liveStart): self
  566.     {
  567.         if($liveStart){
  568.             $liveStart DateTime::createFromFormat('Y-m-d H:i:s'$liveStart);
  569.         }
  570.         
  571.         $this->liveStart $liveStart;
  572.         return $this;
  573.     }
  574.     public function getLiveCover(): ?string
  575.     {
  576.         return $this->liveCover;
  577.     }
  578.     public function setLiveCover(?string $liveCover): self
  579.     {
  580.         $this->liveCover $liveCover;
  581.         return $this;
  582.     }
  583.     public function getLiveLinkTransmit(): ?string
  584.     {
  585.         return $this->liveLinkTransmit;
  586.     }
  587.     public function setLiveLinkTransmit(?string $liveLinkTransmit): self
  588.     {
  589.         $this->liveLinkTransmit $liveLinkTransmit;
  590.         return $this;
  591.     }
  592.     public function getLiveLink(): ?string
  593.     {
  594.         return $this->liveLink;
  595.     }
  596.     public function setLiveLink(?string $liveLink): self
  597.     {
  598.         $this->liveLink $liveLink;
  599.         return $this;
  600.     }
  601.     public function getLiveToken(): ?string
  602.     {
  603.         return $this->liveToken;
  604.     }
  605.     public function setLiveToken(?string $liveToken): self
  606.     {
  607.         $this->liveToken $liveToken;
  608.         return $this;
  609.     }
  610.     public function getLiveIdEvent(): ?string
  611.     {
  612.         return $this->liveIdEvent;
  613.     }
  614.     public function setLiveIdEvent(?string $liveIdEvent): self
  615.     {
  616.         $this->liveIdEvent $liveIdEvent;
  617.         return $this;
  618.     }
  619.     public function getShowLiveViewerNumber(): ?int
  620.     {
  621.         return $this->showLiveViewerNumber;
  622.     }
  623.     public function setShowLiveViewerNumber(?int $showLiveViewerNumber): self
  624.     {
  625.         $this->showLiveViewerNumber $showLiveViewerNumber;
  626.         return $this;
  627.     }
  628.     public function getShowTextPdf(): ?int
  629.     {
  630.         return $this->showTextPdf;
  631.     }
  632.     public function setShowTextPdf(?int $showTextPdf): self
  633.     {
  634.         $this->showTextPdf $showTextPdf;
  635.         return $this;
  636.     }
  637.     public function getPdfSvgMode(): ?int
  638.     {
  639.         return $this->pdfSvgMode;
  640.     }
  641.     public function setPdfSvgMode(int $pdfSvgMode): self
  642.     {
  643.         $this->pdfSvgMode $pdfSvgMode;
  644.         return $this;
  645.     }
  646.     public function getUser(): ?User
  647.     {
  648.         return $this->user;
  649.     }
  650.     public function setUser(?User $user): self
  651.     {
  652.         $this->user $user;
  653.         return $this;
  654.     }
  655.     public function getUserDelete(): ?User
  656.     {
  657.         return $this->userDelete;
  658.     }
  659.     public function setUserDelete(?User $userDelete): self
  660.     {
  661.         $this->userDelete $userDelete;
  662.         return $this;
  663.     }
  664.     public function getDateDelete($dateFormat 'Y-m-d H:i:s')
  665.     {
  666.         if($this->dateDelete){
  667.             return $this->dateDelete->format($dateFormat);
  668.         }
  669.         return $this->dateDelete;
  670.     }
  671.     public function setDateDelete($dateDelete): self
  672.     {
  673.         if(!empty($dateDelete)){
  674.             $dateDelete DateTime::createFromFormat('Y-m-d H:i:s'$dateDelete);
  675.         }
  676.         
  677.         $this->dateDelete $dateDelete;
  678.         return $this;
  679.     }
  680.     public function isLive(): bool
  681.     {
  682.         return ($this->deleted == LibraryEnum::ITEM_NO_DELETED);
  683.     }
  684.     public function exist(): bool
  685.     {
  686.         return ($this->deleted != LibraryEnum::ITEM_DELETED);
  687.     }
  688.     public function individual(): self
  689.     {
  690.         $this->typeDelete LibraryEnum::INDIVIDUAL;
  691.         return $this;
  692.     }
  693.     public function cascade(): self
  694.     {
  695.         $this->typeDelete LibraryEnum::CASCADE;
  696.         return $this;
  697.     }
  698.     public function isOnTrash(): bool
  699.     {
  700.         return ($this->deleted == LibraryEnum::ITEM_ON_TRASH);
  701.     }
  702.     public function isDeleted(): bool
  703.     {
  704.         return ($this->deleted == LibraryEnum::ITEM_DELETED);
  705.     }
  706.     public function restore(): self
  707.     {
  708.         $this->deleted LibraryEnum::ITEM_NO_DELETED;
  709.         return $this;
  710.     }
  711.     public function trash(): self
  712.     {
  713.         $this->deleted LibraryEnum::ITEM_ON_TRASH;
  714.         return $this;
  715.     }
  716.     public function delete(): self
  717.     {
  718.         $this->deleted LibraryEnum::ITEM_DELETED;
  719.         return $this;
  720.     }
  721.     public function stringType($type){
  722.         $string '';
  723.         switch ($type) {
  724.             case LibraryEnum::CONTENT_EMBED:
  725.                 $string 'Embed';
  726.             break;
  727.             case LibraryEnum::CONTENT_FILES:
  728.                 $string 'Files';
  729.             break;
  730.             case LibraryEnum::CONTENT_AUDIO:
  731.                 $string 'Audio';
  732.             break;
  733.             case LibraryEnum::CONTENT_TEXT:
  734.                 $string 'Text';
  735.             break;
  736.             case LibraryEnum::CONTENT_VIDEO:
  737.                 $string 'Video';
  738.             break;
  739.             case LibraryEnum::CONTENT_LIVE:
  740.                 $string 'Live';
  741.             break;
  742.             case LibraryEnum::CONTENT_CONFERENCE:
  743.                 $string 'Conference';
  744.             break;
  745.             case LibraryEnum::CONTENT_VIDEO_FILE:
  746.                 $string 'Storage';
  747.             break;
  748.         }
  749.         return $string;
  750.     }
  751.     public function toReturn($clean false){
  752.         $data = [
  753.             "id" => $this->id,
  754.             "title" => $this->getTitle(),
  755.             "downloadNumber" => $this->downloadNumber,
  756.             "type" => $this->type,
  757.             "link" => html_entity_decode($this->link),
  758.             "text" => $this->getText(),
  759.             "file" => $this->getFileName(),
  760.             "fileSize" => $this->fileSize,
  761.             "fileExtension" => $this->fileExtension,
  762.             "pagesNumber" => $this->pagesNumber,
  763.             "pdfSvgMode" => $this->pdfSvgMode,
  764.             "duration" => $this->getDuration(),
  765.             "liveStart" => $this->getLiveStart(),
  766.             "userDelete" => ( $this->userDelete $this->userDelete->getId() : null ),
  767.             "typeDelete" => $this->typeDelete,
  768.             "dateDelete" => $this->getDateDelete()
  769.         ];
  770.         if(!$clean){
  771.             $data["deleted"] = $this->deleted;
  772.             $data["status"] = $this->status;
  773.             $data["origin"] = $this->origin;
  774.             $data["vimeoId"] = $this->vimeoId;
  775.             $data["vimeoVideoId"] = $this->vimeoVideoId;
  776.             $data["vdocipherVideoId"] = $this->vdocipherVideoId;
  777.             $data["liveCover"] = $this->liveCover;
  778.             $data["liveLinkTransmit"] = $this->liveLinkTransmit;
  779.             $data["liveLink"] = $this->liveLink;
  780.             $data["liveToken"] = $this->liveToken;
  781.             $data["showLiveViewerNumber"] = $this->showLiveViewerNumber;
  782.             $data["liveIdEvent"] = $this->liveIdEvent;
  783.             $data["showTextPdf"] = $this->showTextPdf;
  784.             $data["user"] = ( $this->user $this->user->getId() : null );
  785.         }
  786.         return $data;
  787.     }
  788.     public function toReturnApi(){
  789.         $data = [
  790.             "id" => $this->id,
  791.             "arquivo" => $this->getTitle(),
  792.             "extensao" => $this->fileExtension,
  793.             "tipo_conteudo" => $this->type,
  794.             "url" => $this->link,
  795.             "texto" => $this->text,
  796.             "paginas" => $this->pagesNumber,
  797.             "duracao" => $this->getDuration(),
  798.             "status" => $this->status
  799.         ];
  800.         
  801.         return $data;
  802.     }
  803. }