Jackalope\Transport\Jackrabbit\Client::fetchEventData PHP Method

fetchEventData() public method

Internal method to fetch event data.
public fetchEventData ( $date ) : array
$date
return array hashmap with 'data' containing unfiltered DOM of xml atom feed of events, 'nextMillis' is the next timestamp if there are more events to be found, false otherwise.
    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);
    }

Usage Example

 /**
  * {@inheritDoc}
  */
 public function fetchEventData($date)
 {
     return $this->transport->fetchEventData($date);
 }