You are here

class MigrateExtrasNodeFlagHandler in Migrate Extras 7.2

Because we can't identify what kind of entity is passed to complete, we implement a separate handler for each type.

Hierarchy

Expanded class hierarchy of MigrateExtrasNodeFlagHandler

1 string reference to 'MigrateExtrasNodeFlagHandler'
migrate_extras_migrate_api in ./migrate_extras.migrate.inc

File

./flag.inc, line 130
Flag module integration

View source
class MigrateExtrasNodeFlagHandler extends MigrateExtrasFlagHandler {
  public function __construct() {
    $this
      ->registerTypes(array(
      'node',
    ));
  }
  public function complete($node, stdClass $row) {
    if (!module_exists('flag')) {
      return;
    }
    $flags = flag_get_flags('node', $node->type);
    $fields = array();
    foreach ($flags as $flag_name => $flag) {
      if (!empty($node->{$flag_name})) {
        flag('flag', $flag_name, $node->nid);
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MigrateExtrasFlagHandler::fields public function Make the flags assigned to this object visible.
MigrateExtrasNodeFlagHandler::complete public function
MigrateExtrasNodeFlagHandler::__construct public function Overrides MigrateHandler::__construct
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