private function getDataByPath($name): string
    {
        $namePath = explode('.', $name);
        $out = $this->model;

        for ($i=0; $i < count($namePath); $i++) {

            $out = $i+1 < count($namePath) ?
                $out->{$namePath[$i]} : $out->{$namePath[$i].'_'.$this->language->getShortName()};

            if (is_array($out)) {
                for ($j=0; $j < count($out); $j++) {
                    $out[$j] = $out[$j]->{$namePath[$i+1].'_'.$this->language->getShortName()};
                }
                $out = implode(', ', $out);
                break;
            }
        }

        return trim($out, ', ');
    }
private function getDataByPath($name): string
    {
        $namePath = explode('.', $name);
        $out = $this->model;

        for ($i=0; $i < count($namePath); $i++) {

            $out = $i+1 < count($namePath) ?
                $out->{$namePath[$i]} : $out->{$namePath[$i].'_'.$this->language->getShortName()};

            if (is_array($out)) {
                for ($j=0; $j < count($out); $j++) {
                    $out[$j] = $out[$j]->{$namePath[$i+1].'_'.$this->language->getShortName()};
                }
                $out = implode(', ', $out);
                break;
            }
        }

        return trim($out, ', ');
    }
private function getDataByPath ( $ name ) : string { $ namePath = explode ( '.' , $ name ) ; $ out = $ this -> model ; for ( $ i = 0 ; $ i < count ( $ namePath ) ; $ i ++ ) { $ out = $ i + 1 < count ( $ namePath ) ? $ out -> { $ namePath [ $ i ] } : $ out -> { $ namePath [ $ i ] . '_' . $ this -> language -> getShortName ( ) } ; if ( is_array ( $ out ) ) { for ( $ j = 0 ; $ j < count ( $ out ) ; $ j ++ ) { $ out [ $ j ] = $ out [ $ j ] -> { $ namePath [ $ i + 1 ] . '_' . $ this -> language -> getShortName ( ) } ; } $ out = implode ( ', ' , $ out ) ; break ; } } return trim ( $ out , ', ' ) ; }
Obtaining a field translation of another model along a given path through a series
of entities, separated by a point.

@param $name string, separated by dot.

@return string
Obtaining a field translation of another model along a given path through a series of entities separated by a point .