Skip to content

Commit

Permalink
Made sure we don't ever import in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
dkullmann committed Nov 8, 2011
1 parent 4ad2462 commit 103ebaa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions models/rets_import.php
Expand Up @@ -106,6 +106,9 @@ public function startImport($data) {
*/
public function finishImport($data) {
$data['finished'] = true;
if(!empty($data['modified'])) {
unset($data['modified']);
}
$this->set($data);
if(!$this->validates() || !$this->save($data)){
throw new OutOfBoundsException('Unable to start import');
Expand All @@ -125,9 +128,15 @@ public function getImportDates($lastImport = null) {
$lastImport = date('Y-m-d H:i:s', strtotime($this->startImport));
}

$endDate = date('Y-m-d H:i:s', strtotime($this->defaultRange, strtotime($lastImport)));
$time = strtotime($this->defaultRange, strtotime($lastImport));
$now = strtotime('now');
if($time > $now) {
$time = $now;
}
$endDate = date('Y-m-d H:i:s', $time);

return array($lastImport, $endDate);
}

}
?>
?>

0 comments on commit 103ebaa

Please sign in to comment.