ModelBundle/Repository/SiteRepository.php
public function countWithFilterAndSiteIds(PaginateFinderConfiguration $configuration, array $siteIds = null)
    {
        $qa = $this->createAggregateQueryWithDeletedFilter(false);
        if (null !== $siteIds) {
            $qa->match(array('siteId' => array('$in' => $siteIds)));
        }
        $this->filterSearch($configuration, $qa);

        return $this->countDocumentAggregateQuery($qa);
    }
public function countWithFilterAndSiteIds(PaginateFinderConfiguration $configuration, array $siteIds = null)
    {
        $qa = $this->createAggregateQueryWithDeletedFilter(false);
        if (null !== $siteIds) {
            $qa->match(array('siteId' => array('$in' => $siteIds)));
        }
        $this->filterSearch($configuration, $qa);

        return $this->countDocumentAggregateQuery($qa);
    }
@param PaginateFinderConfiguration $configuration
@param array|null                  $siteIds

@return int