Skip to content

Instantly share code, notes, and snippets.

@svandragt
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svandragt/11395740 to your computer and use it in GitHub Desktop.
Save svandragt/11395740 to your computer and use it in GitHub Desktop.
Basic authorative one way sync pattern
<?php
// get $Records from external database
$inactive_ids = $DataObjects->getIDList();
while ($R = $Records->next()) {
$id = $this->ProcessRecord($R);
unset($inactive_ids[$id]);
}
$DataObjects->removeMany($inactive_ids);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment