public function fetchEventData($date)
{
$path = $this->workspaceUri . self::JCR_JOURNAL_PATH;
$request = $this->getRequest(Request::GET, $path, false);
$request->addHeader(sprintf('If-None-Match: "%s"', base_convert($date, 10, 16)));
$curl = $request->execute(true);
// create new DOMDocument and load the response text.
$dom = new DOMDocument();
$dom->loadXML($curl->getResponse());
$next = base_convert(trim($curl->getHeader('ETag'), '"'), 16, 10);
if ($next == $date) {
// no more events
$next = false;
}
return array('data' => $dom, 'nextMillis' => $next);
}