protected function getRelationName($key)
    {
        if (strpos($key, '.') === false) {
            return '';
        }

        $path = explode('.', $key);

        array_pop($path);

        return implode('.', $path);
    }
protected function getRelationName($key)
    {
        if (strpos($key, '.') === false) {
            return '';
        }

        $path = explode('.', $key);

        array_pop($path);

        return implode('.', $path);
    }
protected function getRelationName ( $ key ) { if ( strpos ( $ key , '.' ) === false ) { return '' ; } $ path = explode ( '.' , $ key ) ; array_pop ( $ path ) ; return implode ( '.' , $ path ) ; }
Return the relation name of a key. Just pop the last segment

@param string $key

@return string
Return the relation name of a key . Just pop the last segment