function CreateInterval(REQUEST $req = NULL, $cache_timewindow = false) { $ivls = array(); if ($cache_timewindow) { if ($req) { $iinfo = $req->GetIntervalInfo(); } else { $iinfo = NULL; } //array(); // if (!$req) $req = new DATARequest($args = array()); foreach ($this as $cachewrap) { $cache = $cachewrap->GetCache(); $ivl = new INTERVAL($iinfo); $ivl->ApplyCache($cache); $cache->LimitInterval($ivl); array_push($ivls, $ivl); } } else { if ($req) { $iinfo = $req->GetIntervalInfo(); } else { $iinfo = NULL; } //array(); foreach ($this as $cachewrap) { $cache = $cachewrap->GetCache(); array_push($ivls, $cache->CreateInterval($iinfo)); } } $ivl = new INTERVAL($iinfo); $ivl->ApplyIntervals($ivls); return $ivl; }
function CreateInterval(LOGGROUP $grp = NULL, array &$iinfo = NULL, $flags = 0) { $grp = $this->CheckGroup($grp, $flags); if (!$iinfo) { if ($this->req instanceof DATARequest) { $iinfo = $this->req->GetIntervalInfo(); } } if ($grp->gid < 0) { if (!strcmp($grp->gid, VIRTUALReader::COMPLEX_ID) || !strcmp($grp->gid, VIRTUALReader::SRCTREE_ID)) { $req = $this->srctree->GetRequests(); $ivls = array(); foreach ($req as $greq) { $rdr = $this->CreateReader($greq); $group = $greq->CreateGroup(); array_push($ivls, $rdr->CreateInterval($group, $iinfo)); unset($reader); } $ivl = new INTERVAL($iinfo); $ivl->ApplyIntervals($ivls); return $ivl; } } $req = $this->srctree->GetGroupRequest($grp, $mask); $rdr = $this->CreateReader($req); $group = $rdr->CreateGroup(); $ivl = $rdr->CreateInterval($group, $iinfo); $this->req->LimitInterval($ivl, $group); return $ivl; }