public function ContentEntity::count in Drupal 9
Same name and namespace in other branches
- 8 core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntity::count()
Gets the source count.
Return a count of available source records, from the cache if appropriate. Returns MigrateSourceInterface::NOT_COUNTABLE 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 SourcePluginBase::count
File
- core/
modules/ migrate_drupal/ src/ Plugin/ migrate/ source/ ContentEntity.php, line 245
Class
- ContentEntity
- Source plugin to get content entities from the current version of Drupal.
Namespace
Drupal\migrate_drupal\Plugin\migrate\sourceCode
public function count($refresh = FALSE) {
// If no translations are included, then a simple query is possible.
if (!$this->configuration['include_translations']) {
return parent::count($refresh);
}
// @TODO: Determine a better way to retrieve a valid count for translations.
// https://www.drupal.org/project/drupal/issues/2937166
return MigrateSourceInterface::NOT_COUNTABLE;
}