<?php

namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Category class.
 *
 * @ORM\Entity
 */
class Category
{
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=255, nullable=false)
     * @Assert\NotBlank()
     */
    private $title;

    /**
     * @ORM\ManyToMany(targetEntity="App\Entity\Prospect", mappedBy="categories")
     */
    private $prospects;

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

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

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

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

        return $this;
    }

    /*
     * @return Collection|Prospect[]
     */
//    public function getProspects(): Collection
//    {
//        return $this->prospects;
//    }

//    public function addProspect(Prospect $prospect): self
//    {
//        if (!$this->prospects->contains($prospect)) {
//            $this->prospects[] = $prospect;
//            $prospect->addCategory($this);
//        }
//
//        return $this;
//    }
//
//    public function removeProspect(Prospect $prospect): self
//    {
//        if ($this->prospects->contains($prospect)) {
//            $this->prospects->removeElement($prospect);
//            $prospect->removeCategory($this);
//        }
//
//        return $this;
//    }
}
