<?php

declare(strict_types=1);

namespace Builder\Core\Foundation\Definition\Concerns;

trait Translatable
{
    private bool $translatable = false;

    private ?string $generateFrom = null;

    public function translatable(bool $value = true): self
    {
        $this->translatable = $value;

        return $this;
    }

    public function generateFrom(string $sourceField): self
    {
        $this->generateFrom = $sourceField;

        return $this;
    }

    public function isTranslatable(): bool
    {
        return $this->translatable;
    }

    public function getGenerateFrom(): ?string
    {
        return $this->generateFrom;
    }
}
