public function ForumAccess::import in Forum Access 8
File
- forum_access_migrate/
src/ Plugin/ migrate/ destination/ ForumAccess.php, line 89
Class
- ForumAccess
- Provides table destination plugin.
Namespace
Drupal\forum_access_migrate\Plugin\migrate\destinationCode
public function import(Row $row, array $old_destination_id_values = []) {
// Migrate moderators.
module_load_include('inc', 'forum_access', 'includes/forum_access.acl');
$tid = $row
->getSourceProperty('tid');
$moderators = $row
->getSourceProperty('moderators');
if (!empty($moderators)) {
$acl_id = forum_access_get_acl($tid, 'moderate');
foreach ($moderators as $uid) {
acl_add_user($acl_id, $uid);
}
}
return parent::import($row, $old_destination_id_values);
}