Skip to content
Snippets Groups Projects
Commit 8a73f0c0 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

hotline #42815 fix rt comment

parent dc3101cf
Branches
Tags
1 merge request!1707hotline #42815 upgrage assimil parsing and implement delete non harvested
......@@ -45,14 +45,13 @@ class Class_WebService_BibNumerique_Assimil extends Class_WebService_BibNumeriqu
protected function _deleteNonHarvested() {
if(!$local_ids =
(new Storm_Model_Collection(Class_Album::findAllBy(['type_doc_id' => Class_TypeDoc::ASSIMIL])))
->collect('id_origine'))
return $this;
if($to_delete = array_diff((array) $local_ids, $this->getHarvestedIds()))
(new Storm_Model_Collection(Class_Album::findAllBy(['id_origine' => $to_delete])))
->eachDo('delete');
$harvested_ids = $this->getHarvestedIds();
(new Storm_Model_Collection(Class_Album::findAllBy(['type_doc_id' => Class_TypeDoc::ASSIMIL])))
->reject(
function($album) use($harvested_ids) {
return in_array($album->getIdOrigine(), $harvested_ids);
})
->eachDo('delete');
return $this;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment