<?php

namespace App\Entity;

use App\Repository\ModaliteRepository;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass=ModaliteRepository::class)
 */
class Modalite
{
    /**
     * @ORM\Id
     * @ORM\GeneratedValue
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=255)
     */
    private $name;

    /**
     * @ORM\ManyToOne(targetEntity=Desagregation::class, inversedBy="modalites")
     */
    private $desagregation;

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

    public function __toString()
    {
        return $this->getName();
    }

    public function getName(): ?string
    {
        return $this->name;
    }

    public function setName(string $name): self
    {
        $this->name = $name;

        return $this;
    }

    public function getDesagregation(): ?Desagregation
    {
        return $this->desagregation;
    }

    public function setDesagregation(?Desagregation $desagregation): self
    {
        $this->desagregation = $desagregation;

        return $this;
    }
}
