src/Entity/Setting.php line 13
<?phpnamespace App\Entity;use App\Repository\SettingRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\HttpFoundation\File\File;use Vich\UploaderBundle\Mapping\Annotation as Vich;#[ORM\Entity(repositoryClass: SettingRepository::class)]#[Vich\Uploadable]class Setting{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name_key = null;#[ORM\Column(length: 255, nullable: true)]private ?string $value = null;// NOTE: This is not a mapped field of entity metadata, just a simple property.#[Vich\UploadableField(mapping: 'setting_image', fileNameProperty: 'image',originalName:'nomInitial')]private ?File $imageFile = null;#[ORM\Column(length: 255, nullable: true)]private ?string $image = null;#[ORM\Column(length: 255,nullable: true)]private ?string $nomInitial = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $createdAt = null;#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]private ?\DateTimeInterface $updatedAt = null;#[ORM\Column(type: Types::TEXT, nullable: true)]private ?string $description = null;#[ORM\Column(length: 255, nullable: true)]private ?string $website_name = null;public function __construct(){$this->createdAt = new \DateTimeImmutable('now');$this->updatedAt = new \DateTimeImmutable('now');}public function getId(): ?int{return $this->id;}public function getNameKey(): ?string{return $this->name_key;}public function setNameKey(string $name_key): self{$this->name_key = $name_key;return $this;}public function getValue(): ?string{return $this->value;}public function setValue(?string $value): self{$this->value = $value;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(?string $description): self{$this->description = $description;return $this;}public function getImage(): ?string{return $this->image;}public function setImage(?string $image): self{$this->image = $image;return $this;}/*** If manually uploading a file (i.e. not using Symfony Form) ensure an instance* of 'UploadedFile' is injected into this setter to trigger the update. If this* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter* must be able to accept an instance of 'File' as the bundle will inject one here* during Doctrine hydration.** @param File|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile*/public function setImageFile(?File $imageFile = null): void{$this->imageFile = $imageFile;if (null !== $imageFile) {// It is required that at least one field changes if you are using doctrine// otherwise the event listeners won't be called and the file is lost$this->updatedAt = new \DateTimeImmutable();}}public function getImageFile(): ?File{return $this->imageFile;}public function getNomInitial(): ?string{return $this->nomInitial;}public function setNomInitial(string $nomInitial= null): self{$this->nomInitial = $nomInitial;return $this;}public function getCreatedAt(): ?\DateTimeInterface{return $this->createdAt;}public function setCreatedAt(\DateTimeInterface $createdAt): self{$this->createdAt = $createdAt;return $this;}public function getUpdatedAt(): ?\DateTimeInterface{return $this->updatedAt;}public function setUpdatedAt(?\DateTimeInterface $updatedAt): self{$this->updatedAt = $updatedAt;return $this;}public function getWebsiteName(): ?string{return $this->website_name;}public function setWebsiteName(?string $website_name): self{$this->website_name = $website_name;return $this;}}