+ return;
+ }
+
+ function processCurrRate($currency, $rate, $from, $to)
+ {
+ $curr = DB_DataObject::factory('core_curr_rate');
+
+ $curr->curr = $currency;
+
+ $o = false;
+
+ if($curr->find(true)){
+ $o = clone($curr);
+ }
+
+ $curr->setFrom(array(
+ 'rate' => $rate,
+ 'from_dt' => date('Y-m-d H:i:s', strtotime($from)),
+ 'to_dt' => date('Y-m-d H:i:s', strtotime($to))
+ ));
+
+ (empty($o)) ? $curr->insert() : $curr->update($o);