You are here

public function DisqusCommentsStatus::count in Disqus 8

Gets the source count.

Return a count of available source records, from the cache if appropriate. Returns -1 if the source is not countable.

Parameters

bool $refresh: (optional) Whether or not to refresh the count. Defaults to FALSE. Not all implementations support the reset flag. In such instances this parameter is ignored and the result of calling the method will always be up to date.

Return value

int The count.

Overrides SqlBase::count

File

src/Plugin/migrate/source/DisqusCommentsStatus.php, line 63

Class

DisqusCommentsStatus
Disqus comments status.

Namespace

Drupal\disqus\Plugin\migrate\source

Code

public function count($refresh = FALSE) {
  return $this
    ->getDatabase()
    ->select('node', 'n')
    ->condition('n.type', $this
    ->getEnabledTypes(), 'IN')
    ->countQuery()
    ->execute()
    ->fetchField();
}