You are here

public function SqlBase::count in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/migrate/src/Plugin/migrate/source/SqlBase.php \Drupal\migrate\Plugin\migrate\source\SqlBase::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 SourcePluginBase::count

4 methods override SqlBase::count()
FieldInstancePerViewMode::count in core/modules/field/src/Plugin/migrate/source/d7/FieldInstancePerViewMode.php
Get the source count.
Variable::count in core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php
Get the source count.
ViewMode::count in core/modules/field/src/Plugin/migrate/source/d7/ViewMode.php
Get the source count.
ViewModeBase::count in core/modules/node/src/Plugin/migrate/source/d6/ViewModeBase.php
Get the source count.

File

core/modules/migrate/src/Plugin/migrate/source/SqlBase.php, line 239
Contains \Drupal\migrate\Plugin\migrate\source\SqlBase.

Class

SqlBase
Sources whose data may be fetched via DBTNG.

Namespace

Drupal\migrate\Plugin\migrate\source

Code

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