public function whitelistParameters(array $queryParams, Repository $repo)
    {
        $metadata = $repo->getClassMetadata();
        $allowedParams = array_keys($metadata->getFieldMappings());
        $cleanParams = [];
        foreach ($queryParams as $fieldSelect => $valueSelect) {
            $stack = [];

            if (is_string($valueSelect)) {
                $stack = preg_split('/ *(\|\|\|) */', $fieldSelect);
                $valueStack = preg_split('/ *(\|\|\|) */', $valueSelect);
            }

            if (count($stack) > 1) {
                $allowedKeys = [];
                $allowedVals = [];
                foreach ($stack as $i => $stackItem) {
                    if (in_array($stackItem, $allowedParams)) {
                        $allowedKeys[] = $stackItem;
                        $allowedVals[] = $valueStack[$i];
                    }
                }

                if (!count($allowedKeys)) {
                    return false;
                }
                $allowed = implode(' ||| ', $allowedKeys);
                $cleanParams[$allowed] = implode(' ||| ', $allowedVals);
            } else {
                if (!in_array($fieldSelect, $allowedParams)) {
                    return false;
                }
                $cleanParams[$fieldSelect] = $valueSelect;
            }
        }

        return $cleanParams;
    }