ModelBundle/Repository/NodeRepository.php
public function countNotDeletedVersions($nodeId, $language, $siteId)
    {
        $qa = $this->createAggregationQueryBuilderWithSiteIdAndLanguage($siteId, $language);
        $qa->match(array(
            'nodeId' => $nodeId,
            'deleted'=> false,
        ));

        return $this->countDocumentAggregateQuery($qa);
    }
public function countNotDeletedVersions($nodeId, $language, $siteId)
    {
        $qa = $this->createAggregationQueryBuilderWithSiteIdAndLanguage($siteId, $language);
        $qa->match(array(
            'nodeId' => $nodeId,
            'deleted'=> false,
        ));

        return $this->countDocumentAggregateQuery($qa);
    }
@param string $nodeId
@param string $language
@param string $siteId

@throws \Exception

@return mixed