src/Entity/Projet/Portfolio/Intervention.php line 17

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