Exemplo n.º 1
0
 public static function getInstance()
 {
     if (!self::$WQDFileDataStore) {
         self::$WQDFileDataStore = new WQDFileDataStore();
         return self::$WQDFileDataStore;
     }
     return self::$WQDFileDataStore;
 }
Exemplo n.º 2
0
$limit = 100;
$action = $_GET["feed"];
$locationSeqs = $_GET["locs"];
$lastSeq = $_GET['lastSeq'];
$actionArr = explode(",", $action);
if ($actionArr != null && count($actionArr) > 0) {
    $XML = "<?xml version='1.0' encoding='UTF-8'?>";
    $parentTag = "ELiveDifferentialCall";
    if (in_array($ACTION_WQDFILES, $actionArr) || in_array($ACTION_WQDFILESDATA, $actionArr)) {
        $parentTag = "ELiveFullDataCall";
    }
    $XML .= '<' . $parentTag . ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">';
    foreach ($actionArr as $action) {
        if ($action == $ACTION_WQDFILES) {
            if ($lastSeq != "") {
                $WQDFS = WQDFileDataStore::getInstance();
                $files = $WQDFS->findByLocationSeqLastSeqs($locationSeqs, $lastSeq, $limit);
                $XML .= "<WQDFiles>";
                foreach ($files as $file) {
                    $XML .= getWQDFileXML($file);
                }
                $XML .= "</WQDFiles>";
            }
        } elseif ($action == $ACTION_WQDFILESDATA) {
            if ($lastSeq != "") {
                $WQDDDS = WQDDataDataStore::getInstance();
                $files = $WQDDDS->getWQDDataByLocationSeqsAndLastSeqs($locationSeqs, $lastSeq, $limit);
                $XML .= "<WQDFilesData>";
                foreach ($files as $file) {
                    $XML .= getWQDDataXML($file);
                }