<?php

namespace AppBundle\Entity\Core;

use Doctrine\ORM\Mapping as ORM;
use Dunglas\ApiBundle\Annotation\Iri;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Enum des départements d'un pays
 * (Ex: Haute-Savoie in France)
 *
 * @Iri("http://schema.org/Department")
 */
#[ORM\Entity]
class Department
{
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['department'])]
    private $id;
    /**
     * @var string The name of the item.
     *
     * @Iri("https://schema.org/name")
     */
    #[ORM\Column(type: 'string')]
    #[Assert\Type(type: 'string')]
    #[Assert\NotNull]
    #[Groups(['department'])]
    private $name;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 20)]
    #[Assert\Type(type: 'string')]
    #[Assert\NotNull]
    #[Groups(['department'])]
    private $departmentNumber;
    /**
     * @var Region
     */
    #[ORM\ManyToOne(targetEntity: 'Region')]
    #[ORM\JoinColumn(nullable: false)]
    #[Groups(['department'])]
    private $region;
    /**
     * Sets id.
     *
     * @param int $id
     *
     * @return $this
     */
    public function setId($id)
    {
        $this->id = $id;

        return $this;
    }
    /**
     * Gets id.
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Sets name.
     *
     * @param string $name
     *
     * @return $this
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }
    /**
     * Gets name.
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * Sets departmentNumber.
     *
     * @param string $departmentNumber
     *
     * @return $this
     */
    public function setDepartmentNumber($departmentNumber)
    {
        $this->departmentNumber = $departmentNumber;

        return $this;
    }
    /**
     * Gets departmentNumber.
     *
     * @return string
     */
    public function getDepartmentNumber()
    {
        return $this->departmentNumber;
    }
    /**
     * Sets region.
     *
     * @param Region $region
     *
     * @return $this
     */
    public function setRegion(Region $region = null)
    {
        $this->region = $region;

        return $this;
    }
    /**
     * Gets region.
     *
     * @return Region
     */
    public function getRegion()
    {
        return $this->region;
    }
}
