You are here

public function MigrateSourceMultiItems::computeCount in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 plugins/sources/multiitems.inc \MigrateSourceMultiItems::computeCount()

It's the list class that knows how many records are available, so ask it.

Return value

int

File

plugins/sources/multiitems.inc, line 143
Support for migration from sources where data spans multiple lines (ex. xml, json) and IDs for the items are part of each item and multiple items reside in a single file.

Class

MigrateSourceMultiItems
Implementation of MigrateSource, providing the semantics of iterating over IDs provided by a MigrateItems and retrieving data from a MigrateItems.

Code

public function computeCount() {

  // @API: Support old count method for now.
  if (method_exists($this->itemsClass, 'computeCount')) {
    return $this->itemsClass
      ->computeCount();
  }
  else {
    return $this->itemsClass
      ->count();
  }
}