Skip to content
Snippets Groups Projects
Commit d0659659 authored by Alex Arnaud's avatar Alex Arnaud
Browse files

Dev#163369 : RT fixes follow-up (2)

parent 78e5ac36
1 merge request!4710Dev#163369 connecteur cvs
Pipeline #22880 failed with stage
in 27 minutes and 35 seconds
......@@ -27,7 +27,7 @@ class Cvs2_Harvester extends Class_DigitalResource_Harvester_XML {
$_date_from;
public function __construct(string $catalogue, string $date_from = '1970-01-01') {
public function __construct(string $catalogue, string $date_from = '') {
parent::__construct();
$this->_catalogue = $catalogue;
......
......@@ -135,7 +135,9 @@ class Cvs2_Service extends Class_DigitalResource_Service {
protected function _getLastRunOrDefault(){
$lastdate = '1970-01-01';
if (($batch = Class_Batch::findFirstBy(['type' => 'Cvs2_Batch'])) && $batch->getLastRun())
if (($batch = Class_Batch::findFirstBy(['type' => 'Cvs2_Batch']))
&& $batch->getLastRun()
&& $batch->getLastRun() != '0000-00-00 00:00:00')
$lastdate = $batch->getLastRun();
return $lastdate;
......
......@@ -29,13 +29,13 @@ class Cvs2_Service_Catalogue extends Cvs2_Service {
protected string $_response;
public function __construct(string $cataloguename = 'tout', string $from = '1970-01-01'){
public function __construct(string $cataloguename = 'tout', string $from = ''){
parent::__construct(Cvs2_Config::getInstance());
$this->_harvesting = true;
$this->_catalogue = $cataloguename;
$this->_from = $this->getCurrentDate()
? $this->getCurrentDate()
: $from;
$this->_from = $from
? $from
: $this->getCurrentDate();
$this->_page = 1;
$this->_number_per_page = 100;
}
......@@ -53,14 +53,6 @@ class Cvs2_Service_Catalogue extends Cvs2_Service {
}
public function setFrom(string $from = '' ):self {
$this->_from = $from
? $from
: $this->getCurrentDate();
return $this;
}
public function setResponse(string $xml ):self {
$this->_response = $xml;
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