public function processTranslations(
            array $translations, 
            $trans_key = null, 
            $language_key = 'language_id'){
        
        $approved = [];
        
        foreach($translations as $trans){
            //Check if translation is array at and skip
            if(!is_array($trans)){
                continue;
            }
            //Check for translation key
            if(!is_null($trans_key)){
                unset($trans[$trans_key]);
            }
            if(!isset($this->required_trans) && !empty($this->filterNull($trans,$language_key))){
                $approved[] = $trans;
            }
            elseif(isset($this->required_trans) && $this->checkRequired($trans)){
                $approved[] = $trans;
            }
        }
        return $approved;
    }
public function processTranslations(
            array $translations, 
            $trans_key = null, 
            $language_key = 'language_id'){
        
        $approved = [];
        
        foreach($translations as $trans){
            //Check if translation is array at and skip
            if(!is_array($trans)){
                continue;
            }
            //Check for translation key
            if(!is_null($trans_key)){
                unset($trans[$trans_key]);
            }
            if(!isset($this->required_trans) && !empty($this->filterNull($trans,$language_key))){
                $approved[] = $trans;
            }
            elseif(isset($this->required_trans) && $this->checkRequired($trans)){
                $approved[] = $trans;
            }
        }
        return $approved;
    }
public function processTranslations ( array $ translations , $ trans_key = null , $ language_key = 'language_id' ) { $ approved = [ ] ; foreach ( $ translations as $ trans ) { //Check if translation is array at and skip if ( ! is_array ( $ trans ) ) { continue ; } //Check for translation key if ( ! is_null ( $ trans_key ) ) { unset ( $ trans [ $ trans_key ] ) ; } if ( ! isset ( $ this -> required_trans ) && ! empty ( $ this -> filterNull ( $ trans , $ language_key ) ) ) { $ approved [ ] = $ trans ; } elseif ( isset ( $ this -> required_trans ) && $ this -> checkRequired ( $ trans ) ) { $ approved [ ] = $ trans ; } } return $ approved ; }
Process translation input data for saving them.
@param array $translations
@param string $trans_key translation key field name
@param string $language_key language identifier field
@return array
Process translation input data for saving them .