Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SourcePluginBase.php

function SourcePluginBase::doCount

Gets the source count.

Checks 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.
3 methods override SourcePluginBase::doCount()
ContentEntity::doCount in core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntity.php
Gets the source count.
EmptySource::doCount in core/modules/migrate/src/Plugin/migrate/source/EmptySource.php
Gets the source count.
SqlBase::doCount in core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
Gets the source count using countQuery().

File

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

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());
}
RSS feed
Powered by Drupal