<?php

namespace AutoAdmin\Bundle\Content\Entity\Traits;

/**
 * Trait SlugTrait
 *
 * @package AutoAdmin\Bundle\Content\Entity\Traits
 *
 * Beware: indexed-column max varchar length in utf8_general_ci is 255, or 191 in utf8mb4_general_ci (MySQL limitation)
 */

use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;

trait SlugTrait
{
    #[ORM\Column(name: 'slug', type: Types::STRING, length: 255)]
    #[Groups(['default'])]
    protected string $slug = '';

    public function getSlug(): ?string
    {
        return $this->slug;
    }

    public function setSlug(string $slug): void
    {
        $this->slug = $slug;
    }
}
