src/Entity/Partenaires.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PartenairesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  9. /**
  10.  * @ORM\Entity(repositoryClass=PartenairesRepository::class)
  11.  * @Vich\Uploadable
  12.  */
  13. class Partenaires
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @Assert\NotBlank(message="titre Obligatoire")
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $titre;
  26.     /**
  27.      * @ORM\Column(type="string", length=255, nullable=true)
  28.      */
  29.     private $image;
  30.     /**
  31.      * @Gedmo\Timestampable(on="create")
  32.      * @ORM\Column(type="datetime", nullable=true)
  33.      */
  34.     private $created_at;
  35.     /**
  36.      * @Gedmo\Timestampable(on="update")
  37.      * @ORM\Column(type="datetime", nullable=true)
  38.      */
  39.     private $updated_at;
  40.     /**
  41.      * @Vich\UploadableField(mapping="partenaires_image", fileNameProperty="image")
  42.      * @var File
  43.      */
  44.     private $imageFile;
  45.     /**
  46.      * @ORM\Column(type="boolean", nullable=true)
  47.      */
  48.     private $publier;
  49.     /**
  50.      * @ORM\Column(type="integer", nullable=true)
  51.      */
  52.     private $position;
  53.     /**
  54.      * @ORM\Column(type="boolean", nullable=true)
  55.      */
  56.     private $showinhome;
  57.     /**
  58.      * @ORM\Column(type="boolean", nullable=true)
  59.      */
  60.     private $iscommettant;
  61.     /**
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      */
  64.     private $link;
  65.     public function __toString()
  66.     {
  67.         return $this->titre;
  68.     }
  69.     public function getId(): ?int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getTitre(): ?string
  74.     {
  75.         return $this->titre;
  76.     }
  77.     public function setTitre(?string $titre): self
  78.     {
  79.         $this->titre $titre;
  80.         return $this;
  81.     }
  82.     public function getImage(): ?string
  83.     {
  84.         return $this->image;
  85.     }
  86.     public function setImage(?string $image): self
  87.     {
  88.         $this->image $image;
  89.         return $this;
  90.     }
  91.     public function getCreatedAt(): ?\DateTimeInterface
  92.     {
  93.         return $this->created_at;
  94.     }
  95.     public function setCreatedAt(?\DateTimeInterface $created_at): self
  96.     {
  97.         $this->created_at $created_at;
  98.         return $this;
  99.     }
  100.     public function getUpdatedAt(): ?\DateTimeInterface
  101.     {
  102.         return $this->updated_at;
  103.     }
  104.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  105.     {
  106.         $this->updated_at $updated_at;
  107.         return $this;
  108.     }
  109.     public function setImageFile(File $image null)
  110.     {
  111.         $this->imageFile $image;
  112.         if ($image) {
  113.             $this->updated_at = new \DateTime('now');
  114.         }
  115.         return $this;
  116.     }
  117.     public function getImageFile()
  118.     {
  119.         return $this->imageFile;
  120.     }
  121.     public function getPublier(): ?bool
  122.     {
  123.         return $this->publier;
  124.     }
  125.     public function setPublier(?bool $publier): self
  126.     {
  127.         $this->publier $publier;
  128.         return $this;
  129.     }
  130.     public function getPosition(): ?int
  131.     {
  132.         return $this->position;
  133.     }
  134.     public function setPosition(?int $position): self
  135.     {
  136.         $this->position $position;
  137.         return $this;
  138.     }
  139.     public function getShowinhome(): ?bool
  140.     {
  141.         return $this->showinhome;
  142.     }
  143.     public function setShowinhome(?bool $showinhome): self
  144.     {
  145.         $this->showinhome $showinhome;
  146.         return $this;
  147.     }
  148.     public function getIscommettant(): ?bool
  149.     {
  150.         return $this->iscommettant;
  151.     }
  152.     public function setIscommettant(?bool $iscommettant): self
  153.     {
  154.         $this->iscommettant $iscommettant;
  155.         return $this;
  156.     }
  157.     public function getLink(): ?string
  158.     {
  159.         return $this->link;
  160.     }
  161.     public function setLink(?string $link): self
  162.     {
  163.         $this->link $link;
  164.         return $this;
  165.     }
  166. }