src/Entity/Formation/Domaine.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Formation;
  3. use App\Repository\Formation\DomaineRepository;
  4. use App\Traits\Actions;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\UploadedFile;
  7. /**
  8.  * Domaine
  9.  */
  10. #[ORM\Table(name'hs_tc_formation_domaine')]
  11. #[ORM\Entity(repositoryClassDomaineRepository::class)]
  12. class Domaine implements \Stringable
  13. {
  14.     use Actions;
  15.     final public const SERVER_PATH_TO_IMAGE_FOLDER 'uploads/images/domaine';
  16.     /**
  17.      * @var string
  18.      */
  19.     #[ORM\Column(name'name'type'string'length255)]
  20.     private $name;
  21.     /**
  22.      * @var string
  23.      */
  24.     #[ORM\Column(name'image_name'type'string'length255nullabletrue)]
  25.     protected $imageName 'aucun.jpg';
  26.     protected $imageFile;
  27.     public function __construct()
  28.     {
  29.         // date_default_timezone_set('Africa/Casablanca');
  30.         $this->createAt=new \DateTime('now');
  31.         $this->published=true;
  32.     }
  33.     /**
  34.      * Get id
  35.      *
  36.      * @return integer 
  37.      */
  38.     public function getId()
  39.     {
  40.         return $this->id;
  41.     }
  42.     /**
  43.      * Set nom
  44.      *
  45.      * @param string $name
  46.      * @return Domaine
  47.      */
  48.     public function setName($name)
  49.     {
  50.         $this->name $name;
  51.         return $this;
  52.     }
  53.     /**
  54.      * Get name
  55.      *
  56.      * @return string 
  57.      */
  58.     public function getName()
  59.     {
  60.         return $this->name;
  61.     }
  62.     /**
  63.      * @return string
  64.      */
  65.     public function getImageName()
  66.     {
  67.         return $this->imageName;
  68.     }
  69.     /**
  70.      * @param string $imageName
  71.      * @return Domaine
  72.      */
  73.     public function setImageName($imageName)
  74.     {
  75.         $this->imageName $imageName;
  76.         return $this;
  77.     }
  78.     /**
  79.      * @return mixed
  80.      */
  81.     public function getImageFile()
  82.     {
  83.         return $this->imageFile;
  84.     }
  85.     /**
  86.      * @param mixed $imageFile
  87.      * @return Domaine
  88.      */
  89.     public function setImageFile(UploadedFile $imageFile=null)
  90.     {
  91.         $this->imageFile $imageFile;
  92.         return $this;
  93.     }
  94.     function __toString(): string
  95.     {
  96.         return $this->name;
  97.     }
  98. }