protected function getTotalLocationCount()
    {
        $platform = $this->connection->getDatabasePlatform();

        $queryBuilder = $this->connection->createQueryBuilder();
        $queryBuilder
            ->select($platform->getCountExpression('node_id'))
            ->from('ezcontentobject_tree')
            ->where(
                $queryBuilder->expr()->neq(
                    'node_id',
                    UrlAliasHandler::ROOT_LOCATION_ID
                )
            );

        return $queryBuilder->execute()->fetchColumn();
    }