DataObjects/Core_curr_rate.php
authorAlan Knowles <alan@roojs.com>
Mon, 5 Oct 2015 07:22:17 +0000 (15:22 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 5 Oct 2015 07:22:17 +0000 (15:22 +0800)
DataObjects/Core_curr_rate.php

index 0c24deb..a3b6b6f 100644 (file)
@@ -39,6 +39,14 @@ class Pman_Core_DataObjects_Core_curr_rate extends DB_DataObject
     {
         
         // how often do we need to know this..?
     {
         
         // how often do we need to know this..?
+        // let's assume we do it once a week..
+        $x = DB_DataObject::Factory('core_curr_rate');
+        $x->whereAdd('from_date > NOW() - INTERVAL 7 DAY');
+        if ($x->count()) {
+            return;
+        }
+        
+        
         
         
         if (!empty($this->rates)) {
         
         
         if (!empty($this->rates)) {