8.5.x SourcePluginBase.php SourcePluginBase::doCount()
8.2.x SourcePluginBase.php SourcePluginBase::doCount()
8.3.x SourcePluginBase.php SourcePluginBase::doCount()
8.4.x SourcePluginBase.php SourcePluginBase::doCount()
8.6.x SourcePluginBase.php SourcePluginBase::doCount()

Gets the source count checking if the source is countable or using the iterator_count function.

Return value

int

1 call to SourcePluginBase::doCount()
SourcePluginBase::count in core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
Gets the source count.

File

core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php, line 498

Class

SourcePluginBase
The base class for source plugins.

Namespace

Drupal\migrate\Plugin\migrate\source

Code

protected function doCount() {
  $iterator = $this
    ->getIterator();
  return $iterator instanceof \Countable ? $iterator
    ->count() : iterator_count($this
    ->initializeIterator());
}