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

dev #21332 disable delete album when not in full import

parent 0e3425af
Branches
Tags
3 merge requests!780Master,!736Dev#21332 onedtouch harvest,!731Dev#21332 onedtouch harvest
......@@ -64,7 +64,7 @@ abstract class Class_WebService_BibNumerique_AbstractOAI extends Class_WebServic
protected function _deleteNonHarvested() {
if (0 < count($this->getHarvestedIds()))
if (0 < count($this->getHarvestedIds()) && !self::hasHarvestLog())
Class_Album::getLoader()->deleteBy(['where' => 'url_origine="'. $this->getUrlOrigine() .'" and id_origine not in (\'' . implode("', '", $this->getHarvestedIds()) . '\')']);
}
......@@ -74,6 +74,11 @@ abstract class Class_WebService_BibNumerique_AbstractOAI extends Class_WebServic
}
protected function hasHarvestLog() {
return 0 < Class_WebService_HarvestLog::countBy(['type_doc' => $this->getTypeDoc()]);
}
abstract protected function getTypeDoc();
......
......@@ -198,7 +198,6 @@ class OneDTouchIncTest extends Storm_Test_ModelTestCase {
'titre' => '1Dtouch res']);
$this->onLoaderOfModel('Class_Album')->whenCalled('deleteBy')->answers(true);
$this->_service = new Class_WebService_BibNumerique_OneDTouch();
$this->_service->setTimeSource(new TimeSourceForTest('2015-03-18 10:00:00'));
Class_WebService_BibNumerique_OneDTouch::setDefaultHttpClient($this->_http_client);
......
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