<?php

namespace App\Entity;

use App\Entity\Ag\Main;
use App\Entity\Ag\MainMember;
use App\Entity\Ag\MainSigned;
use App\Entity\Ag\MainVote;
use App\Repository\MembersRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;

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

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

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

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

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

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

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

    #[Vich\UploadableField(mapping: 'members',fileNameProperty: 'memberFileName', size: 'memberSize', mimeType: 'memberMineType', originalName: 'memberOriginalName',dimensions: 'memberDimensions')]
    private ?File $members = null;

    #[ORM\Column(nullable: true)]
    private ?string $memberFileName = null;
    #[ORM\Column(nullable: true)]
    private ?array $memberDimensions = [];
    #[ORM\Column(length: 255,nullable: true)]
    private ?string $memberSize = null;
    #[ORM\Column(length: 255,nullable: true)]
    private ?string $memberMineType = null;
    #[ORM\Column(length: 255,nullable: true)]
    private ?string $memberOriginalName = null;
    #[ORM\Column(nullable: true)]
    private ?\DateTimeImmutable $updateAt;

    #[ORM\Column(nullable: true)]
    private ?\DateTimeImmutable $joinedAt = null;

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

    /**
     * @var Collection<int, MembersCotisations>
     */
    #[ORM\OneToMany(targetEntity: MembersCotisations::class, mappedBy: 'members')]
    private Collection $membersCotisations;

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

    /**
     * @var Collection<int, Main>
     */
    #[ORM\OneToMany(targetEntity: Main::class, mappedBy: 'president')]
    private Collection $ag_president;

    /**
     * @var Collection<int, Main>
     */
    #[ORM\OneToMany(targetEntity: Main::class, mappedBy: 'secretaire')]
    private Collection $secretaire;

    /**
     * @var Collection<int, MainMember>
     */
    #[ORM\OneToMany(targetEntity: MainMember::class, mappedBy: 'member')]
    private Collection $mainMembers;

    /**
     * @var Collection<int, MainVote>
     */
    #[ORM\OneToMany(targetEntity: MainVote::class, mappedBy: 'member')]
    private Collection $agVotes;

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

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

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

    /**
     * @var Collection<int, MainSigned>
     */
    #[ORM\OneToMany(targetEntity: MainSigned::class, mappedBy: 'members')]
    private Collection $mainSigneds;

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

    /**
     * @var Collection<int, MembersCosplan>
     */
    #[ORM\OneToMany(targetEntity: MembersCosplan::class, mappedBy: 'member')]
    private Collection $membersCosplans;

    public function __construct()
    {
        $this->membersCotisations = new ArrayCollection();
        $this->ag_president = new ArrayCollection();
        $this->secretaire = new ArrayCollection();
        $this->mainMembers = new ArrayCollection();
        $this->agVotes = new ArrayCollection();
        $this->mainSigneds = new ArrayCollection();
        $this->membersCosplans = new ArrayCollection();
    }

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

    public function getPseudo(): ?string
    {
        return $this->pseudo;
    }

    public function setPseudo(string $pseudo): static
    {
        $this->pseudo = $pseudo;

        return $this;
    }

    public function getRole(): ?string
    {
        return $this->role;
    }

    public function setRole(string $role): static
    {
        $this->role = $role;

        return $this;
    }

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

    public function setCosplayer(bool $cosplayer): static
    {
        $this->cosplayer = $cosplayer;

        return $this;
    }

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

    public function setCrosscosplayer(bool $crosscosplayer): static
    {
        $this->crosscosplayer = $crosscosplayer;

        return $this;
    }

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

    public function setTrans(bool $trans): static
    {
        $this->trans = $trans;

        return $this;
    }

    public function getOrientation(): ?string
    {
        return $this->orientation;
    }

    public function setOrientation(string $orientation): static
    {
        $this->orientation = $orientation;

        return $this;
    }

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

    /**
     * @return bool|null
     */
    public function getCosplayer(): ?bool
    {
        return $this->cosplayer;
    }

    /**
     * @return bool|null
     */
    public function getCrosscosplayer(): ?bool
    {
        return $this->crosscosplayer;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    public function setJoinedAt(?\DateTimeImmutable $joinedAt): static
    {
        $this->joinedAt = $joinedAt;

        return $this;
    }

    public function getStatus(): ?string
    {
        return $this->status;
    }

    public function setStatus(string $status): static
    {
        $this->status = $status;

        return $this;
    }

    /**
     * @return Collection<int, MembersCotisations>
     */
    public function getMembersCotisations(): Collection
    {
        return $this->membersCotisations;
    }

    public function addMembersCotisation(MembersCotisations $membersCotisation): static
    {
        if (!$this->membersCotisations->contains($membersCotisation)) {
            $this->membersCotisations->add($membersCotisation);
            $membersCotisation->setMembers($this);
        }

        return $this;
    }

    public function removeMembersCotisation(MembersCotisations $membersCotisation): static
    {
        if ($this->membersCotisations->removeElement($membersCotisation)) {
            // set the owning side to null (unless already changed)
            if ($membersCotisation->getMembers() === $this) {
                $membersCotisation->setMembers(null);
            }
        }

        return $this;
    }

    public function getEmail(): ?string
    {
        return $this->Email;
    }

    public function setEmail(string $Email): static
    {
        $this->Email = $Email;

        return $this;
    }

    /**
     * @return Collection<int, Main>
     */
    public function getAgPresident(): Collection
    {
        return $this->ag_president;
    }

    public function addAgPresident(Main $agPresident): static
    {
        if (!$this->ag_president->contains($agPresident)) {
            $this->ag_president->add($agPresident);
            $agPresident->setPresident($this);
        }

        return $this;
    }

    public function removeAgPresident(Main $agPresident): static
    {
        if ($this->ag_president->removeElement($agPresident)) {
            // set the owning side to null (unless already changed)
            if ($agPresident->getPresident() === $this) {
                $agPresident->setPresident(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, Main>
     */
    public function getSecretaire(): Collection
    {
        return $this->secretaire;
    }

    public function addSecretaire(Main $secretaire): static
    {
        if (!$this->secretaire->contains($secretaire)) {
            $this->secretaire->add($secretaire);
            $secretaire->setSecretaire($this);
        }

        return $this;
    }

    public function removeSecretaire(Main $secretaire): static
    {
        if ($this->secretaire->removeElement($secretaire)) {
            // set the owning side to null (unless already changed)
            if ($secretaire->getSecretaire() === $this) {
                $secretaire->setSecretaire(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, MainMember>
     */
    public function getMainMembers(): Collection
    {
        return $this->mainMembers;
    }

    public function addMainMember(MainMember $mainMember): static
    {
        if (!$this->mainMembers->contains($mainMember)) {
            $this->mainMembers->add($mainMember);
            $mainMember->setMember($this);
        }

        return $this;
    }

    public function removeMainMember(MainMember $mainMember): static
    {
        if ($this->mainMembers->removeElement($mainMember)) {
            // set the owning side to null (unless already changed)
            if ($mainMember->getMember() === $this) {
                $mainMember->setMember(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection<int, MainVote>
     */
    public function getAgVotes(): Collection
    {
        return $this->agVotes;
    }

    public function addAgVote(MainVote $agVote): static
    {
        if (!$this->agVotes->contains($agVote)) {
            $this->agVotes->add($agVote);
            $agVote->setMember($this);
        }

        return $this;
    }

    public function removeAgVote(MainVote $agVote): static
    {
        if ($this->agVotes->removeElement($agVote)) {
            // set the owning side to null (unless already changed)
            if ($agVote->getMember() === $this) {
                $agVote->setMember(null);
            }
        }

        return $this;
    }

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

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

        return $this;
    }

    public function getSurname(): ?string
    {
        return $this->surname;
    }

    public function setSurname(?string $surname): static
    {
        $this->surname = $surname;

        return $this;
    }

    public function getCiv(): ?string
    {
        return $this->civ;
    }

    public function setCiv(?string $civ): static
    {
        $this->civ = $civ;

        return $this;
    }

    /**
     * @return Collection<int, MainSigned>
     */
    public function getMainSigneds(): Collection
    {
        return $this->mainSigneds;
    }

    public function addMainSigned(MainSigned $mainSigned): static
    {
        if (!$this->mainSigneds->contains($mainSigned)) {
            $this->mainSigneds->add($mainSigned);
            $mainSigned->setMembers($this);
        }

        return $this;
    }

    public function removeMainSigned(MainSigned $mainSigned): static
    {
        if ($this->mainSigneds->removeElement($mainSigned)) {
            // set the owning side to null (unless already changed)
            if ($mainSigned->getMembers() === $this) {
                $mainSigned->setMembers(null);
            }
        }

        return $this;
    }

    public function getMembersPage(): ?MembersPage
    {
        return $this->membersPage;
    }

    public function setMembersPage(?MembersPage $membersPage): static
    {
        // unset the owning side of the relation if necessary
        if ($membersPage === null && $this->membersPage !== null) {
            $this->membersPage->setMember(null);
        }

        // set the owning side of the relation if necessary
        if ($membersPage !== null && $membersPage->getMember() !== $this) {
            $membersPage->setMember($this);
        }

        $this->membersPage = $membersPage;

        return $this;
    }

    /**
     * @return Collection<int, MembersCosplan>
     */
    public function getMembersCosplans(): Collection
    {
        return $this->membersCosplans;
    }

    public function addMembersCosplan(MembersCosplan $membersCosplan): static
    {
        if (!$this->membersCosplans->contains($membersCosplan)) {
            $this->membersCosplans->add($membersCosplan);
            $membersCosplan->setMember($this);
        }

        return $this;
    }

    public function removeMembersCosplan(MembersCosplan $membersCosplan): static
    {
        if ($this->membersCosplans->removeElement($membersCosplan)) {
            // set the owning side to null (unless already changed)
            if ($membersCosplan->getMember() === $this) {
                $membersCosplan->setMember(null);
            }
        }

        return $this;
    }
}
