You are here

public function EntityTranslationSettings::count in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_translation/src/Plugin/migrate/source/d7/EntityTranslationSettings.php \Drupal\content_translation\Plugin\migrate\source\d7\EntityTranslationSettings::count()

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

core/modules/content_translation/src/Plugin/migrate/source/d7/EntityTranslationSettings.php, line 191

Class

EntityTranslationSettings
Drupal 7 Entity Translation settings from variables.

Namespace

Drupal\content_translation\Plugin\migrate\source\d7

Code

public function count($refresh = FALSE) {

  // Since the number of variables we fetch with query() does not match the
  // actual number of rows generated by initializeIterator(), we need to
  // override count() to return the correct count.
  return (int) $this
    ->initializeIterator()
    ->count();
}