<?php

namespace App\Entity;

use App\Repository\MembersPageRepository;
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: MembersPageRepository::class)]
#[Vich\Uploadable()]
class MembersPage
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\OneToOne(inversedBy: 'membersPage', cascade: ['persist', 'remove'])]
    private ?Members $member = null;

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

    #[ORM\Column(type: Types::TEXT, nullable: true)]
    private ?string $description = null;

    #[Vich\UploadableField(mapping: 'members_page_avatar',fileNameProperty: 'avatarFileName', size: 'avatarSize', mimeType: 'avatarMineType', originalName: 'avatarOriginalName',dimensions: 'avatarDimensions')]
    private ?File $avatar = null;

    #[ORM\Column(nullable: true)]
    private ?string $avatarFileName = null;
    #[ORM\Column(nullable: true)]
    private ?array $avatarDimensions = [];
    #[ORM\Column(length: 255,nullable: true)]
    private ?string $avatarSize = null;
    #[ORM\Column(length: 255,nullable: true)]
    private ?string $avatarMineType = null;
    #[ORM\Column(length: 255,nullable: true)]
    private ?string $avatarOriginalName = null;
    #[ORM\Column(nullable: true)]
    private ?\DateTimeImmutable $updateAt;

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

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

    public function getMember(): ?Members
    {
        return $this->member;
    }

    public function setMember(?Members $member): static
    {
        $this->member = $member;

        return $this;
    }

    public function getTitle(): ?string
    {
        return $this->title;
    }

    public function setTitle(string $title): static
    {
        $this->title = $title;

        return $this;
    }

    public function getDescription(): ?string
    {
        return $this->description;
    }

    public function setDescription(?string $description): static
    {
        $this->description = $description;

        return $this;
    }

    /**
     * @return \DateTimeImmutable|null
     */
    public function getUpdateAt(): ?\DateTimeImmutable
    {
        return $this->updateAt;
    }

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @param \DateTimeImmutable|null $updateAt
     */
    public function setUpdateAt(?\DateTimeImmutable $updateAt): void
    {
        $this->updateAt = $updateAt;
    }

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

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

    public function setIsApproved(bool $isApproved): static
    {
        $this->isApproved = $isApproved;

        return $this;
    }
}
