src/Entity/Users/User/Slideaccueil.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Users\User;
  3. use App\Repository\Users\User\SlideaccueilRepository;
  4. use Symfony\Component\HttpFoundation\File\File;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * @ORM\Table(name="`slideaccueil`")
  10.  * @ORM\Entity(repositoryClass=SlideaccueilRepository::class)
  11.  * @Vich\Uploadable
  12.  */
  13. class Slideaccueil
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     public $contentUrl;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $filePath;
  29.     /**
  30.      * @Vich\UploadableField(mapping="slideaccueil", fileNameProperty="filePath", size="imageSize", mimeType="mimeType", originalName="originalName")
  31.      * @var File|null
  32.      */
  33.     public ?File $file null;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      */
  37.     private $imageSize;
  38.     /**
  39.      * @ORM\Column(type="string", length=255, nullable=true)
  40.      */
  41.     private $originalName;
  42.     /**
  43.      * @ORM\Column(type="datetime")
  44.      */
  45.     private $date;
  46.     /**
  47.      * @ORM\Column(type="string", length=255, nullable=true)
  48.      */
  49.     private $mimeType;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity=User::class)
  52.      * @ORM\JoinColumn(nullable=false)
  53.      */
  54.     private $user;
  55.     /**
  56.      * @ORM\Column(type="string", length=255)
  57.      */
  58.     private $title;
  59.     /**
  60.      * @ORM\Column(type="text", nullable=true)
  61.      */
  62.     private $description;
  63.     /**
  64.      * @ORM\Column(type="string", length=255, nullable=true)
  65.      */
  66.     private $link;
  67.     /**
  68.      * @ORM\Column(type="string", length=255, nullable=true)
  69.      */
  70.     private $videolink;
  71.     public function __construct()
  72.     {
  73.       $this->date = new \Datetime();
  74.     }
  75.     public function getId(): ?int
  76.     {
  77.         return $this->id;
  78.     }
  79.     public function getClientExtension()
  80.     {
  81.         $tabextension explode('.'$this->getOriginalName());
  82.         $nbelem count($tabextension);
  83.         if($nbelem 1)
  84.         {
  85.             return $tabextension[$nbelem 1];
  86.         }else{
  87.             return "";
  88.         }
  89.     }
  90.     public function getTimeOfSendingFiles(): string
  91.     {
  92.         if($this->date != null)
  93.         {
  94.             return $this->date->format('Y-m-d H:i:s');
  95.         }else{
  96.             return "0000-00-00 00:00:00";
  97.         }
  98.     }
  99.     public function getContentUrl(): ?string
  100.     {
  101.         return $this->contentUrl;
  102.     }
  103.     public function setContentUrl(?string $contentUrl): self
  104.     {
  105.         $this->contentUrl $contentUrl;
  106.         return $this;
  107.     }
  108.     public function getFilePath(): ?string
  109.     {
  110.         return $this->filePath;
  111.     }
  112.     public function setFilePath(?string $filePath): self
  113.     {
  114.         $this->filePath $filePath;
  115.         return $this;
  116.     }
  117.     public function getImageSize(): ?string
  118.     {
  119.         return $this->imageSize;
  120.     }
  121.     public function setImageSize(?string $imageSize): self
  122.     {
  123.         $this->imageSize $imageSize;
  124.         return $this;
  125.     }
  126.     public function getOriginalName(): ?string
  127.     {
  128.         return $this->originalName;
  129.     }
  130.     public function setOriginalName(?string $originalName): self
  131.     {
  132.         $this->originalName $originalName;
  133.         return $this;
  134.     }
  135.     public function getDate(): ?\DateTimeInterface
  136.     {
  137.         return $this->date;
  138.     }
  139.     public function setDate(\DateTimeInterface $date): self
  140.     {
  141.         $this->date $date;
  142.         return $this;
  143.     }
  144.     public function getMimeType(): ?string
  145.     {
  146.         return $this->mimeType;
  147.     }
  148.     public function setMimeType(string $mimeType null): self
  149.     {
  150.         $this->mimeType $mimeType;
  151.         return $this;
  152.     }
  153.     public function getUser(): ?User
  154.     {
  155.         return $this->user;
  156.     }
  157.     public function setUser(?User $user): self
  158.     {
  159.         $this->user $user;
  160.         return $this;
  161.     }
  162.     public function getTitle(): ?string
  163.     {
  164.         return $this->title;
  165.     }
  166.     public function setTitle(string $title): self
  167.     {
  168.         $this->title $title;
  169.         return $this;
  170.     }
  171.     public function getDescription(): ?string
  172.     {
  173.         return $this->description;
  174.     }
  175.     public function setDescription(?string $description): self
  176.     {
  177.         $this->description $description;
  178.         return $this;
  179.     }
  180.     public function getLink(): ?string
  181.     {
  182.         return $this->link;
  183.     }
  184.     public function setLink(?string $link): self
  185.     {
  186.         $this->link $link;
  187.         return $this;
  188.     }
  189.     public function getVideolink(): ?string
  190.     {
  191.         return $this->videolink;
  192.     }
  193.     public function setVideolink(?string $videolink): self
  194.     {
  195.         $this->videolink $videolink;
  196.         return $this;
  197.     }
  198. }