private function countNodes($classname)
    {
        $query = sprintf(
                'SELECT COUNT(%s) FROM %s', 
                $this->requiredFields['uid'], 
                $this->em->getClassMetadata($classname)->getTableName()
        );

        $count = $this->em->getConnection()
                        ->executeQuery($query)
                        ->fetchAll(\PDO::FETCH_COLUMN);

        return array_pop($count);
    }