/** * method to check if the file already processed */ protected function isFileReceived($filename, $type, $more_fields = array()) { $log = Billrun_Factory::db()->logCollection(); $logData = $this->getFileLogData($filename, $type, $more_fields); $query = array('stamp' => $logData['stamp'], 'source' => $type, 'file_name' => $filename); if (!empty($more_fields)) { $query = array_merge($query, Billrun_Util::arrayToMongoQuery($query)); } //Billrun_Factory::dispatcher()->trigger('alertisFileReceivedQuery', array(&$query, $type, $this)); $resource = $log->query($query)->cursor()->limit(1); return $resource->count() > 0; }