You are here

abstract class MigrateHandler in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 includes/handler.inc \MigrateHandler

Abstract base class for destination handlers. Handler objects are expected to implement appropriate methods (e.g., prepare, complete, or fields).

Hierarchy

Expanded class hierarchy of MigrateHandler

File

includes/handler.inc, line 12
Defines the base class for destination handlers.

View source
abstract class MigrateHandler {

  /**
   * List of other handler classes which should be invoked before the current
   * one.
   *
   * @var array
   */
  protected $dependencies = array();
  public function getDependencies() {
    return $this->dependencies;
  }

  /**
   * List of "types" handled by this handler. Depending on the kind of handler,
   * these may be destination types, field types, etc.
   *
   * @var array
   */
  protected $typesHandled = array();
  public function getTypesHandled() {
    return $this->typesHandled;
  }

  /**
   * Register a list of types handled by this class
   *
   * @param array $types
   */
  protected function registerTypes(array $types) {

    // Make the type names the keys
    foreach ($types as $type) {
      $type = drupal_strtolower($type);
      $this->typesHandled[$type] = $type;
    }
  }

  /**
   * Does this handler handle the given type?
   *
   * @param boolean $type
   */
  public function handlesType($type) {
    return isset($this->typesHandled[strtolower($type)]);
  }
  public abstract function __construct();

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateHandler::$dependencies protected property List of other handler classes which should be invoked before the current one.
MigrateHandler::$typesHandled protected property List of "types" handled by this handler. Depending on the kind of handler, these may be destination types, field types, etc.
MigrateHandler::getDependencies public function
MigrateHandler::getTypesHandled public function
MigrateHandler::handlesType public function Does this handler handle the given type? 1
MigrateHandler::registerTypes protected function Register a list of types handled by this class
MigrateHandler::__construct abstract public function 11