src/Entity/Service.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ServiceRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. #[ORM\Entity(repositoryClassServiceRepository::class)]
  10. #[Vich\Uploadable]
  11. class Service
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[Gedmo\Slug(fields: ['social_network'])]
  18.     #[ORM\Column(length255,uniquetrue)]
  19.     private ?string $slug null;
  20.     #[Gedmo\Slug(fields: ['category'])]
  21.     #[ORM\Column(length255,uniquetrue)]
  22.     private ?string $slug_category null;
  23.     #[Gedmo\Slug(fields: ['quality'])]
  24.     #[ORM\Column(length255,uniquetrue)]
  25.     private ?string $slug_qualitynull;
  26.     #[ORM\Column]
  27.     private ?int $code null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $social_network null;
  30.     #[ORM\Column(length255)]
  31.     private ?string $quality null;
  32.     #[ORM\Column]
  33.     private ?float $price null;
  34.     #[ORM\Column(length10)]
  35.     private ?string $currency null;
  36.     #[ORM\Column]
  37.     private ?int $min null;
  38.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  39.     private ?\DateTimeInterface $createdAt null;
  40.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  41.     private ?\DateTimeInterface $updatedAt null;
  42.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  43.     private ?\DateTimeInterface $deletedAt null;
  44.     // NOTE: This is not a mapped field of entity metadata, just a simple property.
  45. //    #[Vich\UploadableField(mapping: 'service_image', fileNameProperty: 'image',originalName:'nomInitial')]
  46. //    private ?File $imageFile = null;
  47. //
  48. //    #[ORM\Column(length: 255,nullable: true)]
  49. //    private ?string $image = null;
  50. //
  51. //    #[ORM\Column(length: 255, nullable: true)]
  52. //    private ?string $nomInitial = null;
  53.     // NOTE: This is not a mapped field of entity metadata, just a simple property.
  54. //    #[Vich\UploadableField(mapping: 'service_image_cat', fileNameProperty: 'imageCat',originalName:'nomInitialCat')]
  55. //    private ?File $imageFileCat = null;
  56. //
  57. //    #[ORM\Column(length: 255,nullable: true)]
  58. //    private ?string $imageCat = null;
  59. //
  60. //    #[ORM\Column(length: 255, nullable: true)]
  61. //    private ?string $nomInitialCat = null;
  62.     #[ORM\Column(nullabletrue)]
  63.     private ?bool $actif null;
  64.     #[ORM\Column(length255nullabletrue)]
  65.     private ?string $category null;
  66.     #[ORM\Column(nullabletrue)]
  67.     private ?int $position null;
  68.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  69.     private ?string $description null;
  70.     #[ORM\Column(length255nullabletrue)]
  71.     private ?string $ServiceImage null;
  72.     #[ORM\Column(length255nullabletrue)]
  73.     private ?string $CategoryImage null;
  74.     #[ORM\Column(length255nullabletrue)]
  75.     private ?string $texte_url null;
  76.     public function __construct()
  77.     {
  78.         $this->createdAt = new \DateTimeImmutable('now');
  79.         $this->actif false;
  80.     }
  81.     public function getId(): ?int
  82.     {
  83.         return $this->id;
  84.     }
  85.     public function getCreatedAt(): ?\DateTimeInterface
  86.     {
  87.         return $this->createdAt;
  88.     }
  89.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  90.     {
  91.         $this->createdAt $createdAt;
  92.         return $this;
  93.     }
  94.     public function getUpdatedAt(): ?\DateTimeInterface
  95.     {
  96.         return $this->updatedAt;
  97.     }
  98.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  99.     {
  100.         $this->updatedAt $updatedAt;
  101.         return $this;
  102.     }
  103. //    public function getImage(): ?string
  104. //    {
  105. //        return $this->image;
  106. //    }
  107. //
  108. //    public function setImage(?string $image): self
  109. //    {
  110. //        $this->image = $image;
  111. //
  112. //        return $this;
  113. //    }
  114. //
  115. //    public function getImageCat(): ?string
  116. //    {
  117. //        return $this->imageCat;
  118. //    }
  119. //
  120. //    public function setImageCat(?string $imageCat): self
  121. //    {
  122. //        $this->imageCat = $imageCat;
  123. //
  124. //        return $this;
  125. //    }
  126.     public function getDeletedAt(): ?\DateTimeInterface
  127.     {
  128.         return $this->deletedAt;
  129.     }
  130.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  131.     {
  132.         $this->deletedAt $deletedAt;
  133.         return $this;
  134.     }
  135.     /**
  136.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  137.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  138.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  139.      * must be able to accept an instance of 'File' as the bundle will inject one here
  140.      * during Doctrine hydration.
  141.      *
  142.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  143.      */
  144. //    public function setImageFile(?File $imageFile = null): void
  145. //    {
  146. //        $this->imageFile = $imageFile;
  147. //
  148. //        if (null !== $imageFile) {
  149. //            // It is required that at least one field changes if you are using doctrine
  150. //            // otherwise the event listeners won't be called and the file is lost
  151. //            $this->updatedAt = new \DateTimeImmutable();
  152. //        }
  153. //    }
  154. //
  155. //    public function getImageFile(): ?File
  156. //    {
  157. //        return $this->imageFile;
  158. //    }
  159. //
  160. //
  161. //    public function getNomInitial(): ?string
  162. //    {
  163. //        return $this->nomInitial;
  164. //    }
  165. //
  166. //    public function setNomInitial(?string $nomInitial): self
  167. //    {
  168. //        $this->nomInitial = $nomInitial;
  169. //
  170. //        return $this;
  171. //    }
  172.     /**
  173.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  174.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  175.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  176.      * must be able to accept an instance of 'File' as the bundle will inject one here
  177.      * during Doctrine hydration.
  178.      *
  179.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFileCat
  180.      */
  181. //    public function setImageFileCat(?File $imageFileCat = null): void
  182. //    {
  183. //        $this->imageFileCat = $imageFileCat;
  184. //
  185. //        if (null !== $imageFileCat) {
  186. //            // It is required that at least one field changes if you are using doctrine
  187. //            // otherwise the event listeners won't be called and the file is lost
  188. //            $this->updatedAt = new \DateTimeImmutable();
  189. //        }
  190. //    }
  191. //
  192. //    public function getImageFileCat(): ?File
  193. //    {
  194. //        return $this->imageFileCat;
  195. //    }
  196. //
  197. //
  198. //    public function getNomInitialCat(): ?string
  199. //    {
  200. //        return $this->nomInitialCat;
  201. //    }
  202. //
  203. //    public function setNomInitialCat(?string $nomInitialCat): self
  204. //    {
  205. //        $this->nomInitialCat = $nomInitialCat;
  206. //
  207. //        return $this;
  208. //    }
  209.     /**
  210.      * @param int|null $id
  211.      */
  212.     public function setId(?int $id): void
  213.     {
  214.         $this->id $id;
  215.     }
  216.     public function getSlug(): ?string
  217.     {
  218.         return $this->slug;
  219.     }
  220.     public function getSlugCategory(): ?string
  221.     {
  222.         return $this->slug_category;
  223.     }
  224.     public function getSlugQuality(): ?string
  225.     {
  226.         return $this->slug_quality;
  227.     }
  228.     public function getSocialNetwork(): ?string
  229.     {
  230.         return $this->social_network;
  231.     }
  232.     public function setSocialNetwork(string $social_network): self
  233.     {
  234.         $this->social_network $social_network;
  235.         return $this;
  236.     }
  237.     public function getCode(): ?int
  238.     {
  239.         return $this->code;
  240.     }
  241.     public function setCode(int $code): self
  242.     {
  243.         $this->code $code;
  244.         return $this;
  245.     }
  246.     public function isActif(): ?bool
  247.     {
  248.         return $this->actif;
  249.     }
  250.     public function setActif(?bool $actif): self
  251.     {
  252.         $this->actif $actif;
  253.         return $this;
  254.     }
  255.     public function getQuality(): ?string
  256.     {
  257.         return $this->quality;
  258.     }
  259.     public function setQuality(string $quality): self
  260.     {
  261.         $this->quality $quality;
  262.         return $this;
  263.     }
  264.     public function getPrice(): ?float
  265.     {
  266.         return $this->price;
  267.     }
  268.     public function setPrice(float $price): self
  269.     {
  270.         $this->price $price;
  271.         return $this;
  272.     }
  273.     public function getCurrency(): ?string
  274.     {
  275.         return $this->currency;
  276.     }
  277.     public function setCurrency(string $currency): self
  278.     {
  279.         $this->currency $currency;
  280.         return $this;
  281.     }
  282.     public function getMin(): ?int
  283.     {
  284.         return $this->min;
  285.     }
  286.     public function setMin(int $min): self
  287.     {
  288.         $this->min $min;
  289.         return $this;
  290.     }
  291.     public function getCategory(): ?string
  292.     {
  293.         return $this->category;
  294.     }
  295.     public function setCategory(?string $category): self
  296.     {
  297.         $this->category $category;
  298.         return $this;
  299.     }
  300.     public function getPosition(): ?int
  301.     {
  302.         return $this->position;
  303.     }
  304.     public function setPosition(?int $position): self
  305.     {
  306.         $this->position $position;
  307.         return $this;
  308.     }
  309.     public function getDescription(): ?string
  310.     {
  311.         return $this->description;
  312.     }
  313.     public function setDescription(?string $description): self
  314.     {
  315.         $this->description $description;
  316.         return $this;
  317.     }
  318.     public function getServiceImage(): ?string
  319.     {
  320.         return $this->ServiceImage;
  321.     }
  322.     public function setServiceImage(?string $ServiceImage): static
  323.     {
  324.         $this->ServiceImage $ServiceImage;
  325.         return $this;
  326.     }
  327.     public function getCategoryImage(): ?string
  328.     {
  329.         return $this->CategoryImage;
  330.     }
  331.     public function setCategoryImage(?string $CategoryImage): static
  332.     {
  333.         $this->CategoryImage $CategoryImage;
  334.         return $this;
  335.     }
  336.     public function getTexteUrl(): ?string
  337.     {
  338.         return $this->texte_url;
  339.     }
  340.     public function setTexteUrl(?string $texte_url): static
  341.     {
  342.         $this->texte_url $texte_url;
  343.         return $this;
  344.     }
  345. }