<?php

namespace App\Entity;

use App\Repository\ProductsRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;

#[ORM\Entity(repositoryClass: ProductsRepository::class)]
#[Vich\Uploadable()]
class Products
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\Column(length: 255)]
    private ?string $name = null;

    #[ORM\Column]
    private ?bool $isActive = null;

    #[ORM\Column]
    private ?\DateTimeImmutable $createAt = null;

    #[ORM\Column]
    private ?\DateTimeImmutable $updateAt = null;

    #[ORM\Column]
    private ?float $price = null;

    #[ORM\Column]
    private ?bool $isPromo = null;

    #[ORM\Column]
    private ?bool $isHandmade = null;

    #[ORM\Column]
    private ?bool $isCustom = null;

    #[ORM\Column(length: 255)]
    private ?string $state = null;

    #[ORM\Column(length: 255, nullable: true)]
    private ?string $shortDescription = null;

    #[ORM\Column(type: 'text', nullable: true)]
    private ?string $longDescription = null;


    #[Vich\UploadableField(mapping: 'product',fileNameProperty: 'imageFileName', size: 'imageSize', mimeType: 'imageMineType', originalName: 'imageOriginalName',dimensions: 'imageDimensions')]
    private ?File $image = null;

    #[ORM\Column(nullable: true)]
    private ?string $imageFileName = null;
    #[ORM\Column(nullable: true)]
    private ?array $imageDimensions = [];
    #[ORM\Column(length: 255,nullable: true)]
    private ?string $imageSize = null;
    #[ORM\Column(length: 255,nullable: true)]
    private ?string $imageMineType = null;
    #[ORM\Column(length: 255,nullable: true)]
    private ?string $imageOriginalName = null;

    #[ORM\Column(length: 255)]
    private ?string $ref = null;

    public function getId(): ?int
    {
        return $this->id;
    }

    public function getName(): ?string
    {
        return $this->name;
    }

    public function setName(string $name): static
    {
        $this->name = $name;

        return $this;
    }

    public function isActive(): ?bool
    {
        return $this->isActive;
    }

    public function setIsActive(bool $isActive): static
    {
        $this->isActive = $isActive;

        return $this;
    }

    public function getCreateAt(): ?\DateTimeImmutable
    {
        return $this->createAt;
    }

    public function setCreateAt(\DateTimeImmutable $createAt): static
    {
        $this->createAt = $createAt;

        return $this;
    }

    public function getUpdateAt(): ?\DateTimeImmutable
    {
        return $this->updateAt;
    }

    public function setUpdateAt(\DateTimeImmutable $updateAt): static
    {
        $this->updateAt = $updateAt;

        return $this;
    }

    public function getPrice(): ?float
    {
        return $this->price;
    }

    public function setPrice(float $price): static
    {
        $this->price = $price;

        return $this;
    }

    public function isPromo(): ?bool
    {
        return $this->isPromo;
    }

    public function setIsPromo(bool $isPromo): static
    {
        $this->isPromo = $isPromo;

        return $this;
    }

    public function isHandmade(): ?bool
    {
        return $this->isHandmade;
    }

    public function setIsHandmade(bool $isHandmade): static
    {
        $this->isHandmade = $isHandmade;

        return $this;
    }

    public function isCustom(): ?bool
    {
        return $this->isCustom;
    }

    public function setIsCustom(bool $isCustom): static
    {
        $this->isCustom = $isCustom;

        return $this;
    }

    public function getState(): ?string
    {
        return $this->state;
    }

    public function setState(string $state): static
    {
        $this->state = $state;

        return $this;
    }

    public function getShortDescription(): ?string
    {
        return $this->shortDescription;
    }

    public function setShortDescription(?string $shortDescription): static
    {
        $this->shortDescription = $shortDescription;

        return $this;
    }

    public function getLongDescription(): ?string
    {
        return $this->longDescription;
    }

    public function setLongDescription(?string $longDescription): static
    {
        $this->longDescription = $longDescription;

        return $this;
    }

    /**
     * @return File|null
     */
    public function getImage(): ?File
    {
        return $this->image;
    }

    /**
     * @return array|null
     */
    public function getImageDimensions(): ?array
    {
        return $this->imageDimensions;
    }

    /**
     * @return string|null
     */
    public function getImageFileName(): ?string
    {
        return $this->imageFileName;
    }

    /**
     * @return string|null
     */
    public function getImageMineType(): ?string
    {
        return $this->imageMineType;
    }

    /**
     * @return string|null
     */
    public function getImageOriginalName(): ?string
    {
        return $this->imageOriginalName;
    }

    /**
     * @return string|null
     */
    public function getImageSize(): ?string
    {
        return $this->imageSize;
    }

    /**
     * @param File|null $image
     */
    public function setImage(?File $image): void
    {
        $this->image = $image;
    }

    /**
     * @param array|null $imageDimensions
     */
    public function setImageDimensions(?array $imageDimensions): void
    {
        $this->imageDimensions = $imageDimensions;
    }

    /**
     * @param string|null $imageFileName
     */
    public function setImageFileName(?string $imageFileName): void
    {
        $this->imageFileName = $imageFileName;
    }

    /**
     * @param string|null $imageMineType
     */
    public function setImageMineType(?string $imageMineType): void
    {
        $this->imageMineType = $imageMineType;
    }

    /**
     * @param string|null $imageOriginalName
     */
    public function setImageOriginalName(?string $imageOriginalName): void
    {
        $this->imageOriginalName = $imageOriginalName;
    }

    /**
     * @param string|null $imageSize
     */
    public function setImageSize(?string $imageSize): void
    {
        $this->imageSize = $imageSize;
    }

    public function getRef(): ?string
    {
        return $this->ref;
    }

    public function setRef(string $ref): static
    {
        $this->ref = $ref;

        return $this;
    }
}
