You are here

protected function Variable::doCount in Drupal 10

Gets the source count using countQuery().

Overrides SqlBase::doCount

1 method overrides Variable::doCount()
SearchPage::doCount in core/modules/search/src/Plugin/migrate/source/d7/SearchPage.php
Gets the source count using countQuery().

File

core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php, line 138

Class

Variable
Drupal 6/7 variable source from database.

Namespace

Drupal\migrate_drupal\Plugin\migrate\source

Code

protected function doCount() {
  if (empty($this->variablesNoRowIfMissing)) {
    return 1;
  }
  $variable_names = array_keys($this
    ->query()
    ->execute()
    ->fetchAllAssoc('name'));
  if (!empty(array_diff($this->variablesNoRowIfMissing, $variable_names))) {
    return 0;
  }
  return 1;
}