<?php

namespace App\Entity;

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

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

    /**
     * @ORM\ManyToOne(targetEntity=TPcMatrixesMilestones::class, inversedBy="tPcMatrixesMilestonesCascades")
     * @Groups({ "t_pc_matrixes_milestones_cascades:read", "t_pc_matrixes_milestones_cascades:write" })
     */
    private $majorCascade;

    /**
     * @ORM\ManyToOne(targetEntity=TPcMatrixesMilestones::class, inversedBy="tPcMatrixesMilestonesCascades")
     * @Groups({ "t_pc_matrixes_milestones_cascades:read", "t_pc_matrixes_milestones_cascades:write" })
     */
    private $minorCascade;

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

    public function getMajorCascade(): ?TPcMatrixesMilestones
    {
        return $this->majorCascade;
    }

    public function setMajorCascade(?TPcMatrixesMilestones $majorCascade): self
    {
        $this->majorCascade = $majorCascade;

        return $this;
    }

    public function getMinorCascade(): ?TPcMatrixesMilestones
    {
        return $this->minorCascade;
    }

    public function setMinorCascade(?TPcMatrixesMilestones $minorCascade): self
    {
        $this->minorCascade = $minorCascade;

        return $this;
    }
}
