<?php

namespace App\Entity;

use App\Repository\AbonementsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity(repositoryClass: AbonementsRepository::class)]
class Abonements
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

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

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

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

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

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

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

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

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

    #[ORM\Column]
    private ?int $duration = null;

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

    public function __construct()
    {
        $this->onBoaringEpages = new ArrayCollection();
    }

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

    public function getStripeId(): ?string
    {
        return $this->stripeId;
    }

    public function setStripeId(?string $stripeId): static
    {
        $this->stripeId = $stripeId;

        return $this;
    }

    public function getPriceHt(): ?float
    {
        return $this->priceHt;
    }

    public function setPriceHt(float $priceHt): static
    {
        $this->priceHt = $priceHt;

        return $this;
    }

    public function getPriceTtc(): ?float
    {
        return $this->priceTtc;
    }

    public function setPriceTtc(float $priceTtc): static
    {
        $this->priceTtc = $priceTtc;

        return $this;
    }

    public function getTva(): ?float
    {
        return $this->tva;
    }

    public function setTva(float $tva): static
    {
        $this->tva = $tva;

        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 getName(): ?string
    {
        return $this->name;
    }

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

        return $this;
    }

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

    public function setIsActif(bool $isActif): static
    {
        $this->isActif = $isActif;

        return $this;
    }

    public function getDuration(): ?int
    {
        return $this->duration;
    }

    public function setDuration(int $duration): static
    {
        $this->duration = $duration;

        return $this;
    }

    /**
     * @return Collection<int, OnBoaringEpage>
     */
    public function getOnBoaringEpages(): Collection
    {
        return $this->onBoaringEpages;
    }

    public function addOnBoaringEpage(OnBoaringEpage $onBoaringEpage): static
    {
        if (!$this->onBoaringEpages->contains($onBoaringEpage)) {
            $this->onBoaringEpages->add($onBoaringEpage);
            $onBoaringEpage->setAbos($this);
        }

        return $this;
    }

    public function removeOnBoaringEpage(OnBoaringEpage $onBoaringEpage): static
    {
        if ($this->onBoaringEpages->removeElement($onBoaringEpage)) {
            // set the owning side to null (unless already changed)
            if ($onBoaringEpage->getAbos() === $this) {
                $onBoaringEpage->setAbos(null);
            }
        }

        return $this;
    }
}
