Cake\ORM\Behavior\TranslateBehavior::locale PHP 메소드

locale() 공개 메소드

Sets all future finds for the bound table to also fetch translated fields for the passed locale. If no value is passed, it returns the currently configured locale
public locale ( string | null $locale = null ) : string
$locale string | null The locale to use for fetching translated records
리턴 string
    public function locale($locale = null)
    {
        if ($locale === null) {
            return $this->_locale ?: I18n::locale();
        }
        return $this->_locale = (string) $locale;
    }