protected function getFieldsForRelationPath($fields, $relationPath) {
        if ('*' == $fields) {
            return '*';
        }

        if (is_array($fields)) { // only implemented for arrays for now
            $final = [];
            foreach ($fields as $column => $as) {
                $cName = is_numeric($column) ? $as : $column;
                if (($relationPath . '.') == substr($cName, 0, strlen($relationPath) + 1)) {
                    $cName = substr($cName, strlen($relationPath) + 1);
                    if (is_numeric($column)) {
                        $final[] = $cName;
                    } else {
                        $final[$cName] = $as;
                    }
                }
            }
            return $final;
        }

        return '*';
    }