You are here

public function MigrateSourceReference::computeCount in Relation 8

Same name and namespace in other branches
  1. 8.2 relation_migrate/relation_migrate.source.inc \MigrateSourceReference::computeCount()
  2. 7 relation_migrate/relation_migrate.source.inc \MigrateSourceReference::computeCount()

Return the number of available source records.

File

relation_migrate/relation_migrate.source.inc, line 72
Source plugin for *reference fields.

Class

MigrateSourceReference
Migration source for *ference field. This source is primary used in relation_migrate to convert *reference entries into relation entities.

Code

public function computeCount() {
  $rows_count = 0;
  foreach ($this->fields as $field_name) {
    $rows_count += \Drupal::database()
      ->query('SELECT count(*) FROM {field_data_' . $field_name . '} WHERE deleted = 0')
      ->fetchField();
  }
  return $rows_count;
}