You are here

public function MigrateExtrasFlagHandler::fields in Migrate Extras 7.2

Make the flags assigned to this object visible.

File

./flag.inc, line 114
Flag module integration

Class

MigrateExtrasFlagHandler
Field handler - this will expose flags as fields on the object they're attached to, and set the flag to the value mapped in addFieldMapping().

Code

public function fields($entity_type, $bundle) {
  $fields = array();
  if (module_exists('flag')) {
    $flags = flag_get_flags($entity_type, $bundle);
    foreach ($flags as $flag_name => $flag) {
      $fields[$flag_name] = $flag->title;
    }
  }
  return $fields;
}