public function sortIds($idList, $strDirection)
    {
        $statement = $this->connection->createQueryBuilder()
            ->select('iid')
            ->from('tl_metamodel_rating')
            ->andWhere('mid=:mid AND aid=:aid AND iid IN (:iids)')
            ->setParameter('mid', $this->getMetaModel()->get('id'))
            ->setParameter('aid', $this->get('id'))
            ->setParameter('iids', $idList, Connection::PARAM_STR_ARRAY)
            ->orderBy('meanvalue', $strDirection)
            ->execute();

        $arrSorted = $statement->fetchAll(\PDO::FETCH_COLUMN, 'iid');

        return ($strDirection == 'DESC')
            ? \array_merge($arrSorted, \array_diff($idList, $arrSorted))
            : \array_merge(\array_diff($idList, $arrSorted), $arrSorted);
    }