<commit_before><?php namespace Palmabit\Multilanguage\Traits;
use L;


trait LanguageHelper
{
    /**
     * Obtain the current lang
     *
     * @return String lingua
     */
    public function getLang()
    {
        return $this->is_admin ? L::get_admin() : L::get();
    }

    /**
     * {@inheritdoc}
     */
    public function generateSlugLang($input)
    {
        return $input["slug"];
    }

    /**
     * {@inheritdoc}
     */
    public function updateSlugLang(&$input, $object)
    {
        if (empty($object->slug) )
        {
            $input['slug_lang'] = $this->generateSlugLang($input);
        }
        else
        {
            unset($input['slug_lang']);
        }
    }
    
}<commit_msg>fix save prodotto senza slug<commit_after><?php namespace Palmabit\Multilanguage\Traits;
use L;


trait LanguageHelper
{
    /**
     * Obtain the current lang
     *
     * @return String lingua
     */
    public function getLang()
    {
        return $this->is_admin ? L::get_admin() : L::get();
    }

    /**
     * {@inheritdoc}
     */
    public function generateSlugLang($input)
    {
        return $input["slug"];
    }

    /**
     * {@inheritdoc}
     */
    public function updateSlugLang(&$input, $object)
    {
        if (empty($object->slug) && isset($input['slug_lang']) )
        {
            $input['slug_lang'] = $this->generateSlugLang($input);
        }
        else
        {
            unset($input['slug_lang']);
        }
    }

}
{'fraction_non_alphanumeric': 0.15037086985839515, 'fraction_numerical': 0.0, 'mean_word_length': 1.8374760994263861, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2647072', 'n_tokens_mistral': 469, 'n_tokens_neox': 476, 'n_words': 81}