public function MigrateDestinationFlagSimple::import in Migrate Extras 6.2
Same name and namespace in other branches
- 7.2 flag.inc \MigrateDestinationFlagSimple::import()
Import a single flag_content.
Parameters
$entity: Object object to build. Prefilled with any fields mapped in the Migration.
$row: Raw source data object - passed through to prepare/complete handlers.
Return value
array Array of key fields of the object that was saved if successful. FALSE on failure.
Overrides MigrateDestination::import
File
- ./
flag.inc, line 56 - Flag module integration
Class
- MigrateDestinationFlagSimple
- Destination class implementing when you want just an insert into flag_content table.
Code
public function import(stdClass $entity, stdClass $row) {
if (isset($entity->timestamp)) {
$entity->timestamp = Migration::timestamp($entity->timestamp);
}
$entity->fid = $this->fid;
if (!empty($entity->fcid)) {
$return = drupal_write_record('flag_content', $entity, 'fcid');
}
else {
$return = drupal_write_record('flag_content', $entity);
}
if ($return) {
return array(
$entity->fcid,
);
}
}