protected function sortByUids($uids, $contents)
    {
        $uids = (array) $uids;

        $orderedUids = [];
        foreach ($uids as $key => $uid) {
            $orderedUids[$uid] = $key;
        }

        $formattedResult = [];
        foreach ($contents as $content) {
            if (isset($orderedUids[$content->getUid()])) {
                $formattedResult[$orderedUids[$content->getUid()]] = $content;
            }
        }

        ksort($formattedResult);

        return $formattedResult;
    }