<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\TMainTargetsPlanningsRepository;
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_main_targets_plannings:read"}, "enable_max_depth"="true", "swagger_definition_name"="Read"},
 *    denormalizationContext={"groups"={"t_main_targets_plannings:write"}, "swagger_definition_name"="Write"}
 * )
 * @ApiFilter(SearchFilter::class, properties={ "id": "exact", "appraisee": "exact", "appraiser": "exact", "witness": "exact", "mainStructureOffice": "exact", "status": "exact", "financialYear": "exact" })
 * @ApiFilter(PropertyFilter::class)
 * @ORM\Entity(repositoryClass=TMainTargetsPlanningsRepository::class)
 */

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

    /**
     * @ORM\ManyToOne(targetEntity=TFinancialYears::class, inversedBy="tMainTargetsPlannings")
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $financialYear;

    /**
     * @ORM\ManyToOne(targetEntity=TWorkFlowStages::class, inversedBy="tMainTargetsPlannings")
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $workflowStage;

    /**
     * @ORM\ManyToOne(targetEntity=TStaffMembers::class, inversedBy="tMainTargetsPlannings")
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write", "t_pc_matrixes_milestones:read" })
     */
    private $appraiser;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $appraiserSign;

    /**
     * @ORM\Column(type="date", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $appraiserSignDate;

    /**
     * @ORM\ManyToOne(targetEntity=TStaffMembers::class, inversedBy="tMainTargetsPlanningsAppraisee")
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write", "t_pc_matrixes_milestones:read" })
     */
    private $appraisee;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $appraiseeSign;

    /**
     * @ORM\Column(type="date", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $appraiseeSignDate;

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

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $witnessSign;

    /**
     * @ORM\Column(type="date", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $witnessSignDate;

    /**
     * @ORM\Column(type="date", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $creationDate;

    /**
     * @ORM\ManyToOne(targetEntity=TMainStructureLevels::class, inversedBy="tMainTargetsPlannings")
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $mainStructureLevel;

    /**
     * @ORM\ManyToOne(targetEntity=TMainStructureOffices::class, inversedBy="tMainTargetsPlannings")
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $mainStructureOffice;

    /**
     * @ORM\Column(type="text", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $parties;

    /**
     * @ORM\Column(type="text", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $preamble;

    /**
     * @ORM\Column(type="text", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $statementOfResponsibility;

    /**
     * @ORM\Column(type="text", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $visionMissionStrategicObjectives;

    /**
     * @ORM\Column(type="text", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $statementOfStrategicIntent;

    /**
     * @ORM\Column(type="text", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $committmentsAndObligations;

    /**
     * @ORM\Column(type="text", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $reportingRequirements;

    /**
     * @ORM\Column(type="text", nullable=true)
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $durationOfPc;

    /**
     * @ORM\ManyToOne(targetEntity=TMainStructureOfficesPositions::class, inversedBy="tMainTargetsPlannings")
     * @Groups({ "t_main_targets_plannings:read", "t_main_targets_plannings:write" })
     */
    private $mainStructureOfficesPositions;

    /**
     * @ORM\OneToMany(targetEntity=TPcMatrixes::class, mappedBy="pc")
     */
    private $tPcMatrixes;

    /**
     * @ORM\OneToMany(targetEntity=TPcMatrixesMilestones::class, mappedBy="pc")
     */
    private $tPcMatrixesMilestones;

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

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

    public function getFinancialYear(): ?TFinancialYears
    {
        return $this->financialYear;
    }

    public function setFinancialYear(?TFinancialYears $financialYear): self
    {
        $this->financialYear = $financialYear;

        return $this;
    }

    public function getWorkflowStage(): ?TWorkFlowStages
    {
        return $this->workflowStage;
    }

    public function setWorkflowStage(?TWorkFlowStages $workflowStage): self
    {
        $this->workflowStage = $workflowStage;

        return $this;
    }

    public function getAppraiser(): ?TStaffMembers
    {
        return $this->appraiser;
    }

    public function setAppraiser(?TStaffMembers $appraiser): self
    {
        $this->appraiser = $appraiser;

        return $this;
    }

    public function getAppraiserSign(): ?string
    {
        return $this->appraiserSign;
    }

    public function setAppraiserSign(?string $appraiserSign): self
    {
        $this->appraiserSign = $appraiserSign;

        return $this;
    }

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

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

        return $this;
    }

    public function getAppraisee(): ?TStaffMembers
    {
        return $this->appraisee;
    }

    public function setAppraisee(?TStaffMembers $appraisee): self
    {
        $this->appraisee = $appraisee;

        return $this;
    }

    public function getAppraiseeSign(): ?string
    {
        return $this->appraiseeSign;
    }

    public function setAppraiseeSign(?string $appraiseeSign): self
    {
        $this->appraiseeSign = $appraiseeSign;

        return $this;
    }

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

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

        return $this;
    }

    public function getWitness(): ?TStaffMembers
    {
        return $this->witness;
    }

    public function setWitness(?TStaffMembers $witness): self
    {
        $this->witness = $witness;

        return $this;
    }

    public function getWitnessSign(): ?string
    {
        return $this->witnessSign;
    }

    public function setWitnessSign(?string $witnessSign): self
    {
        $this->witnessSign = $witnessSign;

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    public function getMainStructureLevel(): ?TMainStructureLevels
    {
        return $this->mainStructureLevel;
    }

    public function setMainStructureLevel(?TMainStructureLevels $mainStructureLevel): self
    {
        $this->mainStructureLevel = $mainStructureLevel;

        return $this;
    }

    public function getMainStructureOffice(): ?TMainStructureOffices
    {
        return $this->mainStructureOffice;
    }

    public function setMainStructureOffice(?TMainStructureOffices $mainStructureOffice): self
    {
        $this->mainStructureOffice = $mainStructureOffice;

        return $this;
    }

    public function getParties(): ?string
    {
        return $this->parties;
    }

    public function setParties(?string $parties): self
    {
        $this->parties = $parties;

        return $this;
    }

    public function getPreamble(): ?string
    {
        return $this->preamble;
    }

    public function setPreamble(?string $preamble): self
    {
        $this->preamble = $preamble;

        return $this;
    }

    public function getStatementOfResponsibility(): ?string
    {
        return $this->statementOfResponsibility;
    }

    public function setStatementOfResponsibility(?string $statementOfResponsibility): self
    {
        $this->statementOfResponsibility = $statementOfResponsibility;

        return $this;
    }

    public function getVisionMissionStrategicObjectives(): ?string
    {
        return $this->visionMissionStrategicObjectives;
    }

    public function setVisionMissionStrategicObjectives(?string $visionMissionStrategicObjectives): self
    {
        $this->visionMissionStrategicObjectives = $visionMissionStrategicObjectives;

        return $this;
    }

    public function getStatementOfStrategicIntent(): ?string
    {
        return $this->statementOfStrategicIntent;
    }

    public function setStatementOfStrategicIntent(?string $statementOfStrategicIntent): self
    {
        $this->statementOfStrategicIntent = $statementOfStrategicIntent;

        return $this;
    }

    public function getCommittmentsAndObligations(): ?string
    {
        return $this->committmentsAndObligations;
    }

    public function setCommittmentsAndObligations(?string $committmentsAndObligations): self
    {
        $this->committmentsAndObligations = $committmentsAndObligations;

        return $this;
    }

    public function getReportingRequirements(): ?string
    {
        return $this->reportingRequirements;
    }

    public function setReportingRequirements(?string $reportingRequirements): self
    {
        $this->reportingRequirements = $reportingRequirements;

        return $this;
    }

    public function getDurationOfPc(): ?string
    {
        return $this->durationOfPc;
    }

    public function setDurationOfPc(?string $durationOfPc): self
    {
        $this->durationOfPc = $durationOfPc;

        return $this;
    }

    public function getMainStructureOfficesPositions(): ?TMainStructureOfficesPositions
    {
        return $this->mainStructureOfficesPositions;
    }

    public function setMainStructureOfficesPositions(?TMainStructureOfficesPositions $mainStructureOfficesPositions): self
    {
        $this->mainStructureOfficesPositions = $mainStructureOfficesPositions;

        return $this;
    }

    /**
     * @return Collection|TPcMatrixes[]
     */
    public function getTPcMatrixes(): Collection
    {
        return $this->tPcMatrixes;
    }

    public function addTPcMatrix(TPcMatrixes $tPcMatrix): self
    {
        if (!$this->tPcMatrixes->contains($tPcMatrix)) {
            $this->tPcMatrixes[] = $tPcMatrix;
            $tPcMatrix->setPc($this);
        }

        return $this;
    }

    public function removeTPcMatrix(TPcMatrixes $tPcMatrix): self
    {
        if ($this->tPcMatrixes->removeElement($tPcMatrix)) {
            // set the owning side to null (unless already changed)
            if ($tPcMatrix->getPc() === $this) {
                $tPcMatrix->setPc(null);
            }
        }

        return $this;
    }

    /**
     * @return Collection|TPcMatrixesMilestones[]
     */
    public function getTPcMatrixesMilestones(): Collection
    {
        return $this->tPcMatrixesMilestones;
    }

    public function addTPcMatrixesMilestone(TPcMatrixesMilestones $tPcMatrixesMilestone): self
    {
        if (!$this->tPcMatrixesMilestones->contains($tPcMatrixesMilestone)) {
            $this->tPcMatrixesMilestones[] = $tPcMatrixesMilestone;
            $tPcMatrixesMilestone->setPc($this);
        }

        return $this;
    }

    public function removeTPcMatrixesMilestone(TPcMatrixesMilestones $tPcMatrixesMilestone): self
    {
        if ($this->tPcMatrixesMilestones->removeElement($tPcMatrixesMilestone)) {
            // set the owning side to null (unless already changed)
            if ($tPcMatrixesMilestone->getPc() === $this) {
                $tPcMatrixesMilestone->setPc(null);
            }
        }

        return $this;
    }

}
