src/Entity/MediaObject.php line 73

Open in your IDE?
  1. <?php
  2. // api/src/Entity/MediaObject.php
  3. namespace App\Entity;
  4. use ApiPlatform\Metadata\ApiProperty;
  5. use ApiPlatform\Metadata\ApiResource;
  6. use ApiPlatform\Metadata\Get;
  7. use ApiPlatform\Metadata\GetCollection;
  8. use ApiPlatform\Metadata\Post;
  9. use ApiPlatform\Metadata\Put;
  10. use ApiPlatform\Metadata\Delete;
  11. use App\Controller\CreateMediaObjectAction;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. use Doctrine\Common\Collections\Collection;
  14. use Doctrine\ORM\Mapping as ORM;
  15. use Symfony\Component\HttpFoundation\File\File;
  16. use Symfony\Component\Serializer\Annotation\Groups;
  17. use Symfony\Component\Validator\Constraints as Assert;
  18. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  19. use ApiPlatform\Metadata\ApiFilter;
  20. use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
  21. use Doctrine\DBAL\Types\Types;
  22. use Symfony\Component\Serializer\Annotation\MaxDepth;
  23. #[Vich\Uploadable]
  24. #[ORM\Entity]
  25. #[ApiResource(
  26.     normalizationContext: ['groups' => ['media_object:read']], 
  27.     denormalizationContext: ['groups' => ['media_object:write']],
  28.     types: ['https://schema.org/MediaObject'],
  29.     operations: [
  30.         new Get(),
  31.         new GetCollection(),
  32.         new Delete(),
  33.         new Put(),
  34.         new Post(
  35.             controllerCreateMediaObjectAction::class, 
  36.             deserializefalse
  37.             validationContext: ['groups' => ['Default''media_object_create']], 
  38.             openapiContext: [
  39.                 'requestBody' => [
  40.                     'content' => [
  41.                         'multipart/form-data' => [
  42.                             'schema' => [
  43.                                 'type' => 'object'
  44.                                 'properties' => [
  45.                                     'file' => [
  46.                                         'type' => 'string'
  47.                                         'format' => 'binary'
  48.                                     ]
  49.                                 ]
  50.                             ]
  51.                         ]
  52.                     ]
  53.                 ]
  54.             ]
  55.         )
  56.     ],
  57.     order: ['sort' => 'DESC''id' => 'DESC'],
  58. )]
  59. #[ApiFilter(SearchFilter::class, properties: [
  60.     'product.id' => 'exact'
  61.     'orders.id' => 'exact',
  62.     'orders.account.user.id' => 'exact',
  63. ])]  
  64. #[ORM\HasLifecycleCallbacks]
  65. class MediaObject
  66. {
  67.     #[Groups(['media_object:read''product:read''cat:read',  'user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read','order_product:read','user:read''account:read''load_invoice:read''worker:read''account_worker:read''job:read''site_product:read''user_docs:read''news:read''product_releted:read''slider:read'])]
  68.     #[ORM\IdORM\ColumnORM\GeneratedValue]
  69.     private ?int $id null;
  70.     #[ApiProperty(types: ['https://schema.org/contentUrl'])]
  71.     #[Groups(['media_object:read''product:read''cat:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read','order_product:read''user:read''account:read''load_invoice:read''worker:read''account_worker:read''job:read''site_product:read''user_docs:read''news:read''product_releted:read''slider:read'])]
  72.     public ?string $contentUrl null;
  73.     
  74.     #[Vich\UploadableField(mapping"media_object"fileNameProperty"filePath")]
  75.     #[Assert\NotNull(groups: ['media_object_create'])]
  76.     public ?File $file null;
  77.     #[Groups(['media_object:read''product:read''cat:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read','order_product:read''user:read''account:read''load_invoice:read''worker:read''account_worker:read''job:read''site_product:read''slider:read'])]
  78.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  79.     public $uploadTimestamp;
  80.     
  81.     #[Groups(['media_object:read''product:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read','order_product:read','user:read''account:read''load_invoice:read''worker:read''account_worker:read''job:read''cat:read''site_product:read''slider:read'])]  
  82.     #[ORM\Column(nullabletrue)]
  83.     private ?bool $main null;
  84.     #[ORM\Column(nullabletrue)] 
  85.     #[Groups(['media_object:read''product:read''cat:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read','order_product:read''user:read''account:read''load_invoice:read''worker:read''account_worker:read''job:read''site_product:read''slider:read'])]
  86.     public ?string $filePath null;
  87.     
  88.     #[Groups(['media_object_create'])]
  89.     #[ORM\ManyToOne(inversedBy'media')]
  90.     private ?Products $product null;
  91.     #[Groups(['media_object_create'])]
  92.     #[ORM\ManyToOne(inversedBy'mediaObjects')]
  93.     private ?Orders $orders null;
  94.     #[Groups(['media_object:read''media_object_create'])]
  95.     #[ORM\Column(length100nullabletrue)]
  96.     private ?string $type null;
  97.     #[Groups(['media_object:read''media_object_create'])]
  98.     #[ORM\Column(length255nullabletrue)]
  99.     private ?string $name null;
  100.     #[Groups(['media_object_create'])]
  101.     #[ORM\ManyToOne(inversedBy'mediaObjects')]
  102.     private ?User $users null;
  103.     #[ORM\OneToMany(mappedBy'media'targetEntityUsersDocs::class)]
  104.     private Collection $usersDocs;
  105.     #[Groups(['media_object_create'])]
  106.     #[ORM\ManyToOne(inversedBy'media')]
  107.     private ?AccountWorker $accountWorker null;
  108.     
  109.     #[Groups(['media_object_create'])]
  110.     #[ORM\ManyToOne(inversedBy'media')]
  111.     private ?FormAnswer $formAnswer null;
  112.     #[Groups(['media_object_create'])]
  113.     #[ORM\ManyToOne(inversedBy'mediaObjects'cascade:['persist'])]
  114.     private ?Jobs $job null;
  115.     #[ORM\OneToMany(mappedBy'photo'targetEntityWorkers::class, cascade:['persist'])]
  116.     private Collection $workers;
  117.     #[ORM\OneToMany(mappedBy'document'targetEntityAccountJobsList::class, cascade:['persist'])]
  118.     private Collection $accountJobsLists;
  119.     #[ORM\OneToMany(mappedBy'commandment'targetEntityJobs::class, cascade:['persist'])]
  120.     private Collection $commandment_jobs;
  121.     #[ORM\OneToMany(mappedBy'graph'targetEntityJobs::class, cascade:['persist'])]
  122.     private Collection $graph_jobs;
  123.     #[ORM\OneToMany(mappedBy'protocole'targetEntityJobs::class, cascade:['persist'])]
  124.     private Collection $protocole_jobs;
  125.     #[ORM\OneToMany(mappedBy'mainMedia'targetEntityProducts::class)]
  126.     private Collection $MainProducts;
  127.     #[Groups(['media_object:read''product:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read','order_product:read','user:read''account:read''load_invoice:read''worker:read''account_worker:read''job:read''site_product:read''cat:read''news:read''product_releted:read'])]
  128.     #[ORM\Column(nullabletrue)]
  129.     private ?int $size null;
  130.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'resizeImagings')]
  131.     private ?self $resizeImgParent null;
  132.     #[Groups(['media_object:read''product:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read','order_product:read','user:read''account:read''load_invoice:read''worker:read''account_worker:read''job:read''site_product:read''cat:read''news:read''product_releted:read'])]
  133.     #[ORM\OneToMany(mappedBy'resizeImgParent'targetEntityself::class, cascade:['persist''remove'])]
  134.     private Collection $resizeImagings;
  135.     #[ORM\OneToMany(mappedBy'media'targetEntitySiteProductsMedia::class, cascade:['persist''remove'])]
  136.     private Collection $siteProductsMedia;
  137.  
  138.     #[ORM\OneToMany(mappedBy'media'targetEntityCategory::class, cascade:['persist'])]
  139.     private Collection $categories;
  140.     #[ORM\OneToMany(mappedBy'media'targetEntitySlide::class)]
  141.     private Collection $slides;
  142.     #[ORM\OneToMany(mappedBy'mainMediaHover'targetEntityProducts::class)]
  143.     private Collection $productsHover;
  144.     #[ORM\OneToMany(mappedBy'media'targetEntityNews::class)]
  145.     private Collection $news;
  146.     #[ORM\OneToMany(mappedBy'mobileMedia'targetEntitySlide::class)]
  147.     private Collection $MobileSlides;
  148.     #[Groups(['media_object:read''media_object:write''product:read''user_like:read''pre_order_product:read''pre_order:read''order:read''order_product:read','order_product:read','user:read''account:read''load_invoice:read''worker:read''account_worker:read''job:read''site_product:read''cat:read''news:read''product_releted:read'])]
  149.     #[ORM\Column(nullabletrue)]
  150.     private ?int $sort null;
  151.     public function __construct()
  152.     {
  153.         $this->usersDocs = new ArrayCollection();
  154.         $this->workers = new ArrayCollection();
  155.         $this->accountJobsLists = new ArrayCollection();
  156.         $this->commandment_jobs = new ArrayCollection();
  157.         $this->graph_jobs = new ArrayCollection();
  158.         $this->protocole_jobs = new ArrayCollection();
  159.         $this->MainProducts = new ArrayCollection();
  160.         $this->resizeImagings = new ArrayCollection();
  161.         $this->siteProductsMedia = new ArrayCollection();
  162.         $this->categories = new ArrayCollection();
  163.         $this->slides = new ArrayCollection();
  164.         $this->productsHover = new ArrayCollection();
  165.         $this->news = new ArrayCollection();
  166.         $this->MobileSlides = new ArrayCollection();
  167.     }
  168.     public function getId(): ?int
  169.     
  170.         return $this->id;
  171.     }
  172.     public function getUploadTimestamp(): ?\DateTimeInterface
  173.     {
  174.         return $this->uploadTimestamp;
  175.     }
  176.     public function getProduct(): ?Products
  177.     {
  178.         return $this->product;
  179.     }
  180.     public function setProduct(?Products $product): self
  181.     {
  182.         $this->product $product;
  183.         return $this;
  184.     }
  185.     public function getOrders(): ?Orders
  186.     {
  187.         return $this->orders;
  188.     }
  189.     public function setOrders(?Orders $orders): self
  190.     {
  191.         $this->orders $orders;
  192.         return $this;
  193.     }
  194.     public function getType(): ?string
  195.     {
  196.         return $this->type;
  197.     }
  198.     public function setType(string $type): self
  199.     {
  200.         $this->type $type;
  201.         return $this;
  202.     }
  203.     public function getName(): ?string
  204.     {
  205.         return $this->name;
  206.     }
  207.     public function setName(?string $name): self
  208.     {
  209.         $this->name $name;
  210.         return $this;
  211.     }
  212.     public function getUsers(): ?User
  213.     {
  214.         return $this->users;
  215.     }
  216.     public function setUsers(?User $users): self
  217.     {
  218.         $this->users $users;
  219.         return $this;
  220.     }
  221.     public function getAccountWorker(): ?AccountWorker
  222.     {
  223.         return $this->accountWorker;
  224.     }
  225.     public function setAccountWorker(?AccountWorker $accountWorker): self
  226.     {
  227.         $this->accountWorker $accountWorker;
  228.         return $this;
  229.     }
  230.     
  231.     public function setFormAnswer(?FormAnswer $formAnswer): self
  232.     {
  233.         $this->formAnswer $formAnswer;
  234.         return $this;
  235.     }
  236.     /**
  237.      * @return Collection<int, UsersDocs>
  238.      */
  239.     public function getUsersDocs(): Collection
  240.     {
  241.         return $this->usersDocs;
  242.     }
  243.     public function addUsersDoc(UsersDocs $usersDoc): static
  244.     {
  245.         if (!$this->usersDocs->contains($usersDoc)) {
  246.             $this->usersDocs->add($usersDoc);
  247.             $usersDoc->setMedia($this);
  248.         }
  249.         return $this;
  250.     }
  251.     
  252.     public function getJob(): ?Jobs
  253.     {
  254.         return $this->job;
  255.     }
  256.     public function setJob(?Jobs $job): self
  257.     {
  258.         $this->job $job;
  259.         return $this;
  260.     }
  261.     /**
  262.      * @return Collection<int, Workers>
  263.      */
  264.     public function getWorkers(): Collection
  265.     {
  266.         return $this->workers;
  267.     }
  268.     public function addWorker(Workers $worker): self
  269.     {
  270.         if (!$this->workers->contains($worker)) {
  271.             $this->workers->add($worker);
  272.             $worker->setPhoto($this);
  273.         }
  274.         return $this;
  275.     }
  276.     public function removeUsersDoc(UsersDocs $usersDoc): static
  277.     {
  278.         if ($this->usersDocs->removeElement($usersDoc)) {
  279.             // set the owning side to null (unless already changed)
  280.             if ($usersDoc->getMedia() === $this) {
  281.                 $usersDoc->setMedia(null);
  282.             }
  283.         }
  284.         return $this;
  285.     }
  286.     public function removeWorker(Workers $worker): self
  287.     {
  288.         if ($this->workers->removeElement($worker)) {
  289.             // set the owning side to null (unless already changed)
  290.             if ($worker->getPhoto() === $this) {
  291.                 $worker->setPhoto(null);
  292.             }
  293.         }
  294.         return $this;
  295.     }
  296.     /**
  297.      * @return Collection<int, AccountJobsList>
  298.      */
  299.     public function getAccountJobsLists(): Collection
  300.     {
  301.         return $this->accountJobsLists;
  302.     }
  303.     public function addAccountJobsList(AccountJobsList $accountJobsList): self
  304.     {
  305.         if (!$this->accountJobsLists->contains($accountJobsList)) {
  306.             $this->accountJobsLists->add($accountJobsList);
  307.             $accountJobsList->setDocument($this);
  308.         }
  309.         return $this;
  310.     }
  311.     public function removeAccountJobsList(AccountJobsList $accountJobsList): self
  312.     {
  313.         if ($this->accountJobsLists->removeElement($accountJobsList)) {
  314.             // set the owning side to null (unless already changed)
  315.             if ($accountJobsList->getDocument() === $this) {
  316.                 $accountJobsList->setDocument(null);
  317.             }
  318.         }
  319.         return $this;
  320.     }
  321.     /**
  322.      * @return Collection<int, Jobs>
  323.      */
  324.     public function getCommandmentJobs(): Collection
  325.     {
  326.         return $this->commandment_jobs;
  327.     }
  328.     public function addCommandmentJob(Jobs $commandmentJob): self
  329.     {
  330.         if (!$this->commandment_jobs->contains($commandmentJob)) {
  331.             $this->commandment_jobs->add($commandmentJob);
  332.             $commandmentJob->setCommandment($this);
  333.         }
  334.         return $this;
  335.     }
  336.     public function removeCommandmentJob(Jobs $commandmentJob): self
  337.     {
  338.         if ($this->commandment_jobs->removeElement($commandmentJob)) {
  339.             // set the owning side to null (unless already changed)
  340.             if ($commandmentJob->getCommandment() === $this) {
  341.                 $commandmentJob->setCommandment(null);
  342.             }
  343.         }
  344.         return $this;
  345.     }
  346.     /**
  347.      * @return Collection<int, Jobs>
  348.      */
  349.     public function getGraphJobs(): Collection
  350.     {
  351.         return $this->graph_jobs;
  352.     }
  353.     public function addGraphJob(Jobs $graphJob): self
  354.     {
  355.         if (!$this->graph_jobs->contains($graphJob)) {
  356.             $this->graph_jobs->add($graphJob);
  357.             $graphJob->setGraph($this);
  358.         }
  359.         return $this;
  360.     }
  361.     public function removeGraphJob(Jobs $graphJob): self
  362.     {
  363.         if ($this->graph_jobs->removeElement($graphJob)) {
  364.             // set the owning side to null (unless already changed)
  365.             if ($graphJob->getGraph() === $this) {
  366.                 $graphJob->setGraph(null);
  367.             }
  368.         }
  369.         return $this;
  370.     }
  371.     /**
  372.      * @return Collection<int, Jobs>
  373.      */
  374.     public function getProtocoleJobs(): Collection
  375.     {
  376.         return $this->protocole_jobs;
  377.     }
  378.     public function addProtocoleJob(Jobs $protocoleJob): self
  379.     {
  380.         if (!$this->protocole_jobs->contains($protocoleJob)) {
  381.             $this->protocole_jobs->add($protocoleJob);
  382.             $protocoleJob->setProtocole($this);
  383.         }
  384.         return $this;
  385.     }
  386.     public function removeProtocoleJob(Jobs $protocoleJob): self
  387.     {
  388.         if ($this->protocole_jobs->removeElement($protocoleJob)) {
  389.             // set the owning side to null (unless already changed)
  390.             if ($protocoleJob->getProtocole() === $this) {
  391.                 $protocoleJob->setProtocole(null);
  392.             }
  393.         }
  394.         return $this;
  395.     }
  396.     public function isMain(): ?bool
  397.     {
  398.         return $this->main;
  399.     }
  400.     public function setMain(?bool $main): self
  401.     {
  402.         $this->main $main;
  403.         return $this;
  404.     }
  405.     /**
  406.      * @return Collection<int, Products>
  407.      */
  408.     public function getMainProducts(): Collection
  409.     {
  410.         return $this->MainProducts;
  411.     }
  412.     public function addMainProduct(Products $mainProduct): self
  413.     {
  414.         if (!$this->MainProducts->contains($mainProduct)) {
  415.             $this->MainProducts->add($mainProduct);
  416.             $mainProduct->setMainMedia($this);
  417.         }
  418.         return $this;
  419.     }
  420.     public function removeMainProduct(Products $mainProduct): self
  421.     {
  422.         if ($this->MainProducts->removeElement($mainProduct)) {
  423.             // set the owning side to null (unless already changed)
  424.             if ($mainProduct->getMainMedia() === $this) {
  425.                 $mainProduct->setMainMedia(null);
  426.             }
  427.         }
  428.         return $this;
  429.     }
  430.     #[ORM\PrePersist]
  431.     public function setCreatedAtValue(): void
  432.     {
  433.         $this->uploadTimestamp = new \DateTime(); 
  434.     }
  435.     public function getSize(): ?int
  436.     {
  437.         return $this->size;
  438.     }
  439.     public function setSize(?int $size): static
  440.     {
  441.         $this->size $size;
  442.         return $this;
  443.     }
  444.     public function getResizeImgParent(): ?self
  445.     {
  446.         return $this->resizeImgParent;
  447.     }
  448.     public function setResizeImgParent(?self $resizeImgParent): static
  449.     {
  450.         $this->resizeImgParent $resizeImgParent;
  451.         return $this;
  452.     }
  453.     /**
  454.      * @return Collection<int, self>
  455.      */
  456.     public function getResizeImagings(): Collection
  457.     {
  458.         return $this->resizeImagings;
  459.     }
  460.     public function addResizeImging(self $resizeImging): static
  461.     {
  462.         if (!$this->resizeImagings->contains($resizeImging)) {
  463.             $this->resizeImagings->add($resizeImging);
  464.             $resizeImging->setResizeImgParent($this);
  465.         }
  466.         return $this;
  467.     }
  468.     public function removeResizeImging(self $resizeImging): static
  469.     {
  470.         if ($this->resizeImagings->removeElement($resizeImging)) {
  471.             // set the owning side to null (unless already changed)
  472.             if ($resizeImging->getResizeImgParent() === $this) {
  473.                 $resizeImging->setResizeImgParent(null);
  474.             }
  475.         }
  476.         return $this;
  477.     }
  478.     /**
  479.      * @return Collection<int, SiteProductsMedia>
  480.      */
  481.     public function getSiteProductsMedia(): Collection
  482.     {
  483.         return $this->siteProductsMedia;
  484.     }
  485.     public function addSiteProductsMedium(SiteProductsMedia $siteProductsMedium): static
  486.     {
  487.         if (!$this->siteProductsMedia->contains($siteProductsMedium)) {
  488.             $this->siteProductsMedia->add($siteProductsMedium);
  489.             $siteProductsMedium->setMedia($this);
  490.         }
  491.         return $this;
  492.     }
  493.     public function removeSiteProductsMedium(SiteProductsMedia $siteProductsMedium): static
  494.     {
  495.         if ($this->siteProductsMedia->removeElement($siteProductsMedium)) {
  496.             // set the owning side to null (unless already changed)
  497.             if ($siteProductsMedium->getMedia() === $this) {
  498.                 $siteProductsMedium->setMedia(null);
  499.             }
  500.         }
  501.         return $this;
  502.     }
  503.     /**
  504.      * @return Collection<int, Category>
  505.      */
  506.     public function getCategories(): Collection
  507.     {
  508.         return $this->categories;
  509.     }
  510.     public function addCategory(Category $category): static
  511.     {
  512.         if (!$this->categories->contains($category)) {
  513.             $this->categories->add($category);
  514.             $category->setMedia($this);
  515.         }
  516.         return $this;
  517.     }
  518.     public function removeCategory(Category $category): static
  519.     {
  520.         if ($this->categories->removeElement($category)) {
  521.             // set the owning side to null (unless already changed)
  522.             if ($category->getMedia() === $this) {
  523.                 $category->setMedia(null);
  524.             }
  525.         }
  526.         return $this;
  527.     }
  528.     /**
  529.      * @return Collection<int, Slide>
  530.      */
  531.     public function getSlides(): Collection
  532.     {
  533.         return $this->slides;
  534.     }
  535.     public function addSlide(Slide $slide): static
  536.     {
  537.         if (!$this->slides->contains($slide)) {
  538.             $this->slides->add($slide);
  539.             $slide->setMedia($this);
  540.         }
  541.         return $this;
  542.     }
  543.     public function removeSlide(Slide $slide): static
  544.     {
  545.         if ($this->slides->removeElement($slide)) {
  546.             // set the owning side to null (unless already changed)
  547.             if ($slide->getMedia() === $this) {
  548.                 $slide->setMedia(null);
  549.             }
  550.         }
  551.         return $this;
  552.     }
  553.     /**
  554.      * @return Collection<int, Products>
  555.      */
  556.     public function getProductsHover(): Collection
  557.     {
  558.         return $this->productsHover;
  559.     }
  560.     public function addProductsHover(Products $productsHover): static
  561.     {
  562.         if (!$this->productsHover->contains($productsHover)) {
  563.             $this->productsHover->add($productsHover);
  564.             $productsHover->setMainMediaHover($this);
  565.         }
  566.         return $this;
  567.     }
  568.     public function removeProductsHover(Products $productsHover): static
  569.     {
  570.         if ($this->productsHover->removeElement($productsHover)) {
  571.             // set the owning side to null (unless already changed)
  572.             if ($productsHover->getMainMediaHover() === $this) {
  573.                 $productsHover->setMainMediaHover(null);
  574.             }
  575.         }
  576.         return $this;
  577.     }
  578.     /**
  579.      * @return Collection<int, News>
  580.      */
  581.     public function getNews(): Collection
  582.     {
  583.         return $this->news;
  584.     }
  585.     public function addNews(News $news): static
  586.     {
  587.         if (!$this->news->contains($news)) {
  588.             $this->news->add($news);
  589.             $news->setMedia($this);
  590.         }
  591.         return $this;
  592.     }
  593.     public function removeNews(News $news): static
  594.     {
  595.         if ($this->news->removeElement($news)) {
  596.             // set the owning side to null (unless already changed)
  597.             if ($news->getMedia() === $this) {
  598.                 $news->setMedia(null);
  599.             }
  600.         }
  601.         return $this;
  602.     }
  603.     /**
  604.      * @return Collection<int, Slide>
  605.      */
  606.     public function getMobileSlides(): Collection
  607.     {
  608.         return $this->MobileSlides;
  609.     }
  610.     public function addMobileSlide(Slide $mobileSlide): static
  611.     {
  612.         if (!$this->MobileSlides->contains($mobileSlide)) {
  613.             $this->MobileSlides->add($mobileSlide);
  614.             $mobileSlide->setMobileMedia($this);
  615.         }
  616.         return $this;
  617.     }
  618.     public function removeMobileSlide(Slide $mobileSlide): static
  619.     {
  620.         if ($this->MobileSlides->removeElement($mobileSlide)) {
  621.             // set the owning side to null (unless already changed)
  622.             if ($mobileSlide->getMobileMedia() === $this) {
  623.                 $mobileSlide->setMobileMedia(null);
  624.             }
  625.         }
  626.         return $this;
  627.     }
  628.     public function getSort(): ?int
  629.     {
  630.         return $this->sort;
  631.     }
  632.     public function setSort(?int $sort): static
  633.     {
  634.         $this->sort $sort;
  635.         return $this;
  636.     }
  637. }