Sync: only return modified objects
This commit is contained in:
parent
13a748a287
commit
a5b7e06ba2
|
@ -415,16 +415,25 @@ class Sync
|
||||||
}
|
}
|
||||||
|
|
||||||
$objectKey = $rule->object_type === 'datalistEntry' ? 'entry_name' : 'object_name';
|
$objectKey = $rule->object_type === 'datalistEntry' ? 'entry_name' : 'object_name';
|
||||||
|
$noAction = array();
|
||||||
|
|
||||||
foreach ($objects as $key => $object) {
|
foreach ($objects as $key => $object) {
|
||||||
|
|
||||||
if ($object->hasBeenLoadedFromDb() && $rule->purge_existing === 'y') {
|
if (array_key_exists($key, $newObjects)) {
|
||||||
if (! array_key_exists($key, $newObjects)) {
|
// Stats?
|
||||||
|
|
||||||
|
} elseif ($object->hasBeenLoadedFromDb() && $rule->purge_existing === 'y') {
|
||||||
$object->markForRemoval();
|
$object->markForRemoval();
|
||||||
|
|
||||||
// TODO: this is for stats, preview, summary:
|
// TODO: this is for stats, preview, summary:
|
||||||
// $this->remove[] = $object;
|
// $this->remove[] = $object;
|
||||||
|
} else {
|
||||||
|
$noAction[] = $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($noAction as $key) {
|
||||||
|
unset($objects[$key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $objects;
|
return $objects;
|
||||||
|
|
Loading…
Reference in New Issue