<?php

namespace AppBundle\Entity\Core;

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


/**
 * Tag, étiquette
 */
#[ORM\Entity]
class Tag
{
    /**
     * @var int
     */
    #[ORM\Column(type: 'integer')]
    #[ORM\Id]
    #[ORM\GeneratedValue(strategy: 'AUTO')]
    #[Groups(['tag'])]
    private $id;
    /**
     * @var int
     */
    #[ORM\ManyToOne(targetEntity: 'Tagging', inversedBy: 'tags')]
    #[Groups(['tag'])]
    private $tagging;
    /**
     * @var string
     */
    #[ORM\Column(type: 'string', length: 50)]
    #[Assert\Type(type: 'string')]
    #[Assert\NotNull]
    #[Groups(['tag'])]
    private $name;
    public function __construct($name = null)
    {
      $this->name = $name;
    }
    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }
    /**
     * Set name
     *
     * @param string $name
     *
     * @return Tag
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }
    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * Set tagging
     *
     * @param \AppBundle\Entity\Core\Tagging $tagging
     *
     * @return Tag
     */
    public function setTagging(\AppBundle\Entity\Core\Tagging $tagging = null)
    {
        $this->tagging = $tagging;

        return $this;
    }
    /**
     * Get tagging
     *
     * @return \AppBundle\Entity\Core\Tagging
     */
    public function getTagging()
    {
        return $this->tagging;
    }
}
