ModelBundle/Repository/NodeRepository.php
public function hasNodeIdWithoutAutoUnpublishToState($nodeId, $siteId)
    {
        $qa = $this->createAggregationQueryBuilderWithSiteId($siteId);
        $qa->match(
            array(
                'nodeId'  => $nodeId,
                'status.autoUnpublishToState' => false
            )
        );

        return 0 !== $this->countDocumentAggregateQuery($qa);
    }
public function hasNodeIdWithoutAutoUnpublishToState($nodeId, $siteId)
    {
        $qa = $this->createAggregationQueryBuilderWithSiteId($siteId);
        $qa->match(
            array(
                'nodeId'  => $nodeId,
                'status.autoUnpublishToState' => false
            )
        );

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

@return int