src/Entity/Library.php line 516

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