You are here

abstract class MigrateItems in Migrate 6.2

Same name and namespace in other branches
  1. 7.2 plugins/sources/multiitems.inc \MigrateItems

Extend the MigrateItems class to provide a means to obtain a list of IDs to be migrated from a given source (e.g., MigrateItemsXML extends MigrateItem to obtain a list of IDs from an XML document). This class also provides a means to obtain the data for a given migratable item given its ID.

Hierarchy

Expanded class hierarchy of MigrateItems

File

plugins/sources/multiitems.inc, line 16
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.

View source
abstract class MigrateItems {
  public function __construct() {
  }

  /**
   * Implementors are expected to return a string representing where the listing
   * is obtained from (a URL, file directory, etc.)
   *
   * @return string
   */
  public abstract function __toString();

  /**
   * Implementors are expected to return an array of unique IDs, suitable for
   * passing to the MigrateItem class to retrieve the data for a single item.
   *
   * @return Mixed, iterator or array
   */
  public abstract function getIdList();

  /**
   * Implementors are expected to return a count of IDs available to be migrated.
   *
   * @return int
   */
  public abstract function computeCount();

  /**
   * Implementors are expected to return an object representing a source item.
   *
   * @param mixed $id
   *
   * @return stdClass
   */
  public abstract function getItem($id);

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateItems::computeCount abstract public function Implementors are expected to return a count of IDs available to be migrated. 1
MigrateItems::getIdList abstract public function Implementors are expected to return an array of unique IDs, suitable for passing to the MigrateItem class to retrieve the data for a single item. 1
MigrateItems::getItem abstract public function Implementors are expected to return an object representing a source item. 1
MigrateItems::__construct public function 1
MigrateItems::__toString abstract public function Implementors are expected to return a string representing where the listing is obtained from (a URL, file directory, etc.) 1