<?php

namespace App\Entity;

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

/**
 * @ORM\Entity(repositoryClass=TourClaimRepository::class)
 */
class TourClaim
{
    public const NUM_ITEMS = 15;
    
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity=TourRequest::class, inversedBy="TourClaim")
     * @ORM\JoinColumn(nullable=false)
     */
    private $tourRequest;

    /**
     * @ORM\Column(type="date")
     */
    private $submitionDate;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $startingDate;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $endingDate;

    /**
     * @ORM\Column(type="string", length=2000)
     */
    private $tourDetails;

    /**
     * @ORM\OneToMany(targetEntity=TourClaimDetails::class, mappedBy="tourClaim", cascade={"persist", "remove", "detach"})
     */
    private $tourClaimDetails;

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

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

    public function getTourRequest(): ?TourRequest
    {
        return $this->tourRequest;
    }

    public function setTourRequest(?TourRequest $tourRequest): self
    {
        $this->tourRequest = $tourRequest;

        return $this;
    }

    public function getSubmitionDate(): ?\DateTimeInterface
    {
        return $this->submitionDate;
    }

    public function setSubmitionDate(\DateTimeInterface $submitionDate): self
    {
        $this->submitionDate = $submitionDate;

        return $this;
    }

    public function getStartingDate(): ?\DateTimeInterface
    {
        return $this->startingDate;
    }

    public function setStartingDate(?\DateTimeInterface $startingDate): self
    {
        $this->startingDate = $startingDate;

        return $this;
    }

    public function getEndingDate(): ?\DateTimeInterface
    {
        return $this->endingDate;
    }

    public function setEndingDate(?\DateTimeInterface $endingDate): self
    {
        $this->endingDate = $endingDate;

        return $this;
    }

    public function getTourDetails(): ?string
    {
        return $this->tourDetails;
    }

    public function setTourDetails(string $tourDetails): self
    {
        $this->tourDetails = $tourDetails;

        return $this;
    }

    /**
     * @return Collection|TourClaimDetails[]
     */
    public function getTourClaimDetails(): Collection
    {
        return $this->tourClaimDetails;
    }

    public function addTourClaimDetail(TourClaimDetails $tourClaimDetail): self
    {
        if (!$this->tourClaimDetails->contains($tourClaimDetail)) {
            $this->tourClaimDetails[] = $tourClaimDetail;
            $tourClaimDetail->setTourClaim($this);
        }

        return $this;
    }

    public function removeTourClaimDetail(TourClaimDetails $tourClaimDetail): self
    {
        if ($this->tourClaimDetails->removeElement($tourClaimDetail)) {
            // set the owning side to null (unless already changed)
            if ($tourClaimDetail->getTourClaim() === $this) {
                $tourClaimDetail->setTourClaim(null);
            }
        }

        return $this;
    }

}
