<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\TProjectsCommitteesRepository;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;

use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Serializer\Filter\PropertyFilter;
use Symfony\Component\Serializer\Annotation\Groups;

/**
 * @ApiResource(
 *    normalizationContext={"groups"={"t_projects_committees:read"}, "enable_max_depth"="true", "swagger_definition_name"="Read"},
 *    denormalizationContext={"groups"={"t_projects_committees:write"}, "swagger_definition_name"="Write"}
 * )
 * @ApiFilter(SearchFilter::class, properties={ "id": "exact" })
 * @ApiFilter(PropertyFilter::class)
 * @ORM\Entity(repositoryClass=TProjectsCommitteesRepository::class)
 */

class TProjectsCommittees
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     * @Groups({ "t_projects_committees:read", "t_projects_committees:write" })
     */
    private $id;

    /**
     * @ORM\ManyToOne(targetEntity=TSubCounties::class, inversedBy="tProjectsCommittees")
     * @Groups({ "t_projects_committees:read", "t_projects_committees:write" })
     */
    private $subCounty;

    /**
     * @ORM\ManyToOne(targetEntity=TStaffMembers::class, inversedBy="tProjectsCommittees")
     * @Groups({ "t_projects_committees:read", "t_projects_committees:write" })
     */
    private $staffMember;

    /**
     * @ORM\ManyToOne(targetEntity=TProjects::class, inversedBy="tProjectsCommittees")
     * @Groups({ "t_projects_committees:read", "t_projects_committees:write" })
     */
    private $project;

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

    public function getSubCounty(): ?TSubCounties
    {
        return $this->subCounty;
    }

    public function setSubCounty(?TSubCounties $subCounty): self
    {
        $this->subCounty = $subCounty;

        return $this;
    }

    public function getStaffMember(): ?TStaffMembers
    {
        return $this->staffMember;
    }

    public function setStaffMember(?TStaffMembers $staffMember): self
    {
        $this->staffMember = $staffMember;

        return $this;
    }

    public function getProject(): ?TProjects
    {
        return $this->project;
    }

    public function setProject(?TProjects $project): self
    {
        $this->project = $project;

        return $this;
    }
}
