You are here

public function Variable::count in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php \Drupal\migrate_drupal\Plugin\migrate\source\Variable::count()

Get 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: Whether or not to refresh the count.

Return value

int The count.

Overrides SqlBase::count

File

core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php, line 66
Contains \Drupal\migrate_drupal\Plugin\migrate\source\Variable.

Class

Variable
Drupal variable source from database.

Namespace

Drupal\migrate_drupal\Plugin\migrate\source

Code

public function count() {
  return intval($this
    ->query()
    ->countQuery()
    ->execute()
    ->fetchField() > 0);
}