You are here

public function EmbeddedDataSource::count in Drupal 9

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

2 calls to EmbeddedDataSource::count()
CacheableEmbeddedDataSource::doCount in core/modules/migrate/tests/modules/migrate_cache_counts_test/src/Plugin/migrate/source/CacheableEmbeddedDataSource.php
Gets the source count checking if the source is countable or using the iterator_count function.
EmbeddedDataSource::fields in core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php
Returns available fields on the source.
1 method overrides EmbeddedDataSource::count()
CacheableEmbeddedDataSource::count in core/modules/migrate/tests/modules/migrate_cache_counts_test/src/Plugin/migrate/source/CacheableEmbeddedDataSource.php
Gets the source count.

File

core/modules/migrate/src/Plugin/migrate/source/EmbeddedDataSource.php, line 116

Class

EmbeddedDataSource
Allows source data to be defined in the configuration of the source plugin.

Namespace

Drupal\migrate\Plugin\migrate\source

Code

public function count($refresh = FALSE) {
  return count($this->dataRows);
}