<?php

namespace AutoAdmin\Bundle\Content\Entity\Traits;

use AutoAdmin\Bundle\Content\Entity\Locale;
use AutoAdmin\Bundle\Content\Model\LocaleInterface;
use Doctrine\ORM\Mapping as ORM;

trait LocalizedTrait
{
    #[ORM\ManyToOne(targetEntity: Locale::class)]
    protected ?LocaleInterface $locale = null;

    public function getLocale(): ?LocaleInterface
    {
        return $this->locale;
    }

    public function setLocale(?LocaleInterface $locale): void
    {
        $this->locale = $locale;
    }
}