<?php

namespace App\Entity;

use App\Repository\IndividualDataRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusTrait;

/**
 * @ORM\Entity(repositoryClass=IndividualDataRepository::class)
 */
class IndividualData implements StatusInterface, EntityInterface
{
    use StatusTrait;

    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

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

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

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

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

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $introAnswer;

    /**
     * @ORM\OneToMany(targetEntity=Revolts::class, mappedBy="individualData")
     */
    private $revolts;

    /**
     * @ORM\OneToMany(targetEntity=Dreams::class, mappedBy="individualData")
     */
    private $dreams;

    /**
     * @ORM\OneToMany(targetEntity=ProjectsBoost::class, mappedBy="individualData")
     */
    private $projectsBoost;

    /**
     * @ORM\OneToMany(targetEntity=ProjectsInspiring::class, mappedBy="individualData")
     */
    private $projectsInspiring;

    /**
     * @ORM\OneToMany(targetEntity=Territory::class, mappedBy="individualData")
     */
    private $territory;

    public function __construct()
    {
        $this->revolts = new ArrayCollection();
        $this->dreams = new ArrayCollection();
        $this->projectsBoost = new ArrayCollection();
        $this->projectsInspiring = new ArrayCollection();
        $this->territory = new ArrayCollection();
    }

    public function __toString()
    {
        return $this->firstname . " " . $this->lastname;
    }

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

    public function getFirstname(): ?string
    {
        return $this->firstname;
    }

    public function setFirstname(string $firstname): self
    {
        $this->firstname = $firstname;

        return $this;
    }

    public function getLastname(): ?string
    {
        return $this->lastname;
    }

    public function setLastname(string $lastname): self
    {
        $this->lastname = $lastname;

        return $this;
    }

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

    public function setEmail(string $email): self
    {
        $this->email = $email;

        return $this;
    }

    public function getIntroQuestion(): ?string
    {
        return $this->introQuestion;
    }

    public function setIntroQuestion(string $introQuestion): self
    {
        $this->introQuestion = $introQuestion;

        return $this;
    }

    public function getIntroAnswer(): ?string
    {
        return $this->introAnswer;
    }

    public function setIntroAnswer(?string $introAnswer): self
    {
        $this->introAnswer = $introAnswer;

        return $this;
    }

    /**
     * @return Collection|Revolts[]
     */
    public function getRevolts(): Collection
    {
        return $this->revolts;
    }

    public function addRevolt(Revolts $revolt): self
    {
        if (!$this->revolts->contains($revolt)) {
            $this->revolts[] = $revolt;
            $revolt->setIndividualData($this);
        }

        return $this;
    }

    public function removeRevolt(Revolts $revolt): self
    {
        if ($this->revolts->removeElement($revolt)) {
            // set the owning side to null (unless already changed)
            if ($revolt->getIndividualData() === $this) {
                $revolt->setIndividualData(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|Dreams[]
     */
    public function getDreams(): Collection
    {
        return $this->dreams;
    }

    public function addDream(Dreams $dream): self
    {
        if (!$this->dreams->contains($dream)) {
            $this->dreams[] = $dream;
            $dream->setIndividualData($this);
        }

        return $this;
    }

    public function removeDream(Dreams $dream): self
    {
        if ($this->dreams->removeElement($dream)) {
            // set the owning side to null (unless already changed)
            if ($dream->getIndividualData() === $this) {
                $dream->setIndividualData(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|ProjectsBoost[]
     */
    public function getProjectsBoost(): Collection
    {
        return $this->projectsBoost;
    }

    public function addProjectsBoost(ProjectsBoost $projectsBoost): self
    {
        if (!$this->projectsBoost->contains($projectsBoost)) {
            $this->projectsBoost[] = $projectsBoost;
            $projectsBoost->setIndividualData($this);
        }

        return $this;
    }

    public function removeProjectsBoost(ProjectsBoost $projectsBoost): self
    {
        if ($this->projectsBoost->removeElement($projectsBoost)) {
            // set the owning side to null (unless already changed)
            if ($projectsBoost->getIndividualData() === $this) {
                $projectsBoost->setIndividualData(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|ProjectsInspiring[]
     */
    public function getProjectsInspiring(): Collection
    {
        return $this->projectsInspiring;
    }

    public function addProjectsInspiring(ProjectsInspiring $projectsInspiring): self
    {
        if (!$this->projectsInspiring->contains($projectsInspiring)) {
            $this->projectsInspiring[] = $projectsInspiring;
            $projectsInspiring->setIndividualData($this);
        }

        return $this;
    }

    public function removeProjectsInspiring(ProjectsInspiring $projectsInspiring): self
    {
        if ($this->projectsInspiring->removeElement($projectsInspiring)) {
            // set the owning side to null (unless already changed)
            if ($projectsInspiring->getIndividualData() === $this) {
                $projectsInspiring->setIndividualData(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|Territory[]
     */
    public function getTerritory(): Collection
    {
        return $this->territory;
    }

    public function addTerritory(Territory $territory): self
    {
        if (!$this->territory->contains($territory)) {
            $this->territory[] = $territory;
            $territory->setIndividualData($this);
        }

        return $this;
    }

    public function removeTerritory(Territory $territory): self
    {
        if ($this->territory->removeElement($territory)) {
            // set the owning side to null (unless already changed)
            if ($territory->getIndividualData() === $this) {
                $territory->setIndividualData(null);
            }
        }

        return $this;
    }
}
