protected function getDotParts($string, $parts, $direction = 'ltr')
    {
        if ($direction == 'ltr') {
            return implode('.', array_slice(explode('.', $string), 0, $parts));
        } else {
            return implode('.', array_slice(explode('.', $string), (substr_count($string, '.') + 1) - $parts, $parts));
        }
    }