concrete/src/Entity/Block/BlockType/BlockType.php
public function getCount($ignoreUnapprovedVersions = false)
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $now = $app->make('date')->getOverridableNow();
        if ($ignoreUnapprovedVersions) {
            $count = $db->GetOne(<<<'EOT'
SELECT
    count(btID)
FROM
    Blocks b
    INNER JOIN CollectionVersionBlocks cvb
        ON b.bID=cvb.bID
    INNER JOIN CollectionVersions cv
        ON cvb.cID=cv.cID AND cvb.cvID=cv.cvID AND cv.cvIsApproved=1 AND (cv.cvPublishDate IS NULL OR cv.cvPublishDate <= ?) AND (cv.cvPublishEndDate IS NULL OR cv.cvPublishEndDate >= ?)
WHERE
    b.btID = ?
EOT
                ,
                [$now, $now, $this->btID]
            );
        } else {
            $count = $db->GetOne("SELECT count(btID) FROM Blocks WHERE btID = ?", array($this->btID));
        }

        return $count;
    }
public function getCount($ignoreUnapprovedVersions = false)
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);
        $now = $app->make('date')->getOverridableNow();
        if ($ignoreUnapprovedVersions) {
            $count = $db->GetOne(<<<'EOT'
SELECT
    count(btID)
FROM
    Blocks b
    INNER JOIN CollectionVersionBlocks cvb
        ON b.bID=cvb.bID
    INNER JOIN CollectionVersions cv
        ON cvb.cID=cv.cID AND cvb.cvID=cv.cvID AND cv.cvIsApproved=1 AND (cv.cvPublishDate IS NULL OR cv.cvPublishDate <= ?) AND (cv.cvPublishEndDate IS NULL OR cv.cvPublishEndDate >= ?)
WHERE
    b.btID = ?
EOT
                ,
                [$now, $now, $this->btID]
            );
        } else {
            $count = $db->GetOne("SELECT count(btID) FROM Blocks WHERE btID = ?", array($this->btID));
        }

        return $count;
    }
public function getCount ( $ ignoreUnapprovedVersions = false ) { $ app = Application :: getFacadeApplication ( ) ; $ db = $ app -> make ( Connection :: class ) ; $ now = $ app -> make ( 'date' ) -> getOverridableNow ( ) ; if ( $ ignoreUnapprovedVersions ) { $ count = $ db -> GetOne ( <<<'EOT'
SELECT
    count(btID)
FROM
    Blocks b
    INNER JOIN CollectionVersionBlocks cvb
        ON b.bID=cvb.bID
    INNER JOIN CollectionVersions cv
        ON cvb.cID=cv.cID AND cvb.cvID=cv.cvID AND cv.cvIsApproved=1 AND (cv.cvPublishDate IS NULL OR cv.cvPublishDate <= ?) AND (cv.cvPublishEndDate IS NULL OR cv.cvPublishEndDate >= ?)
WHERE
    b.btID = ?
EOT , [ $ now , $ now , $ this -> btID ] ) ; } else { $ count = $ db -> GetOne ( "SELECT count(btID) FROM Blocks WHERE btID = ?" , array ( $ this -> btID ) ) ; } return $ count ; }
Returns the number of unique instances of this block throughout the entire site
note - this count could include blocks in areas that are no longer rendered by the theme.

@param bool specify true if you only want to see the number of blocks in active pages

@return int
Returns the number of unique instances of this block throughout the entire site note - this count could include blocks in areas that are no longer rendered by the theme .