100 $tableName = static::getTableName();
102 if ($direction ==
'')
107 $r = ExchangeLogTable::getList(array(
112 '=DIRECTION'=>$direction,
113 '=PROVIDER'=>$provider
117 if ($loggingRecord = $r->fetch())
119 if($loggingRecord[
'MAX_DATE_INSERT'] <>
'')
121 $maxDateInsert = $loggingRecord[
'MAX_DATE_INSERT'];
123 $connection = Main\Application::getConnection();
124 $connection->queryExecute(
"delete from {$tableName} where DATE_INSERT < DATE_SUB('{$date->format("Y-m-d
")}', INTERVAL {$interval} DAY) and DIRECTION='{$direction}' and PROVIDER='{$provider}'");