public static function getRootAlias(QueryBuilder $queryBuilder)
    {
        $aliases = $queryBuilder->getRootAliases();

        /*
         * No aliases?
         * Nothing to do
         */
        if (empty($aliases)) {
            return null;
        }

        return Arrays::getFirstElement($aliases);
    }