<?php

namespace App\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\TWitnessesAssigningsRepository;
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_witnesses_assignings:read"}, "enable_max_depth"="true", "swagger_definition_name"="Read"},
 *    denormalizationContext={"groups"={"t_witnesses_assignings:write"}, "swagger_definition_name"="Write"}
 * )
 * @ApiFilter(SearchFilter::class, properties={ "id": "exact", "appraiseeOfficePosition": "exact", "witnessOfficePosition": "exact" })
 * @ApiFilter(PropertyFilter::class)
 * @ORM\Entity(repositoryClass=TWitnessesAssigningsRepository::class)
 */

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

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

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

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

    public function getAppraiseeOfficePosition(): ?TMainStructureOfficesPositions
    {
        return $this->appraiseeOfficePosition;
    }

    public function setAppraiseeOfficePosition(?TMainStructureOfficesPositions $appraiseeOfficePosition): self
    {
        $this->appraiseeOfficePosition = $appraiseeOfficePosition;

        return $this;
    }

    public function getWitnessOfficePosition(): ?TMainStructureOfficesPositions
    {
        return $this->witnessOfficePosition;
    }

    public function setWitnessOfficePosition(?TMainStructureOfficesPositions $witnessOfficePosition): self
    {
        $this->witnessOfficePosition = $witnessOfficePosition;

        return $this;
    }
}
