Loading sharepoint_rest.api.php +14 −0 Changes for sharepoint_rest.api.php: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -45,3 +45,17 @@ function hook_sharepoint_rest_pull_changes_filter($change) { $filter .= ' and External eq 1'; return $filter; } /** * Is invoked when pulling from SP and the item has been deleted. * * @param $map_entity object * The mapping entity between SP and DP */ function hook_sharepoint_rest_pull_entity_delete($map_entity) { $dp_entity = entity_load_single($map_entity->entity_type, $map_entity->entity_id); $dp_entity->status = 0; // Set a flag to know it was saved from sync $dp_entity->sharepoint_migrate_flag = TRUE; entity_save($map_entity->entity_type, $dp_entity); } sharepoint_rest.cron.inc +1 −3 Changes for sharepoint_rest.cron.inc: 1 added line, 3 removed lines. Original line number Diff line number Diff line Loading @@ -52,9 +52,7 @@ function sharepoint_rest_pull_sharepoint_changes() { $entities = sharepoint_rest_api_get_map_by_sp_item($sp_list_type, $change->ItemId); if (!empty($entities)) { foreach ($entities as $drupal_entity) { $entity = entity_load_single($drupal_entity->entity_type, $drupal_entity->entity_id); $entity->status = 0; entity_save($drupal_entity->entity_type, $entity); module_invoke_all('sharepoint_rest_pull_entity_delete', $drupal_entity); } } } Loading Loading
sharepoint_rest.api.php +14 −0 Changes for sharepoint_rest.api.php: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -45,3 +45,17 @@ function hook_sharepoint_rest_pull_changes_filter($change) { $filter .= ' and External eq 1'; return $filter; } /** * Is invoked when pulling from SP and the item has been deleted. * * @param $map_entity object * The mapping entity between SP and DP */ function hook_sharepoint_rest_pull_entity_delete($map_entity) { $dp_entity = entity_load_single($map_entity->entity_type, $map_entity->entity_id); $dp_entity->status = 0; // Set a flag to know it was saved from sync $dp_entity->sharepoint_migrate_flag = TRUE; entity_save($map_entity->entity_type, $dp_entity); }
sharepoint_rest.cron.inc +1 −3 Changes for sharepoint_rest.cron.inc: 1 added line, 3 removed lines. Original line number Diff line number Diff line Loading @@ -52,9 +52,7 @@ function sharepoint_rest_pull_sharepoint_changes() { $entities = sharepoint_rest_api_get_map_by_sp_item($sp_list_type, $change->ItemId); if (!empty($entities)) { foreach ($entities as $drupal_entity) { $entity = entity_load_single($drupal_entity->entity_type, $drupal_entity->entity_id); $entity->status = 0; entity_save($drupal_entity->entity_type, $entity); module_invoke_all('sharepoint_rest_pull_entity_delete', $drupal_entity); } } } Loading