protected function processTogglResponse($response)
    {
        // We only need to do something if results are paginated
        if ($response->total_count <= 50) {
            return $response->data;
        }

        $reqdata = [];
        $reqdata = json_encode($reqdata);
        $pages = ceil($response->total_count / 50);
        $curr_page = 1;
        $data = $response->data;

        $orig_uri = $this->uri;

        while ($curr_page < $pages) {
            $curr_page++;
            $this->uri .= '&page=' . $curr_page;
            $response = $this->processRequest($reqdata, self::GET);
            $this->_handleError($reqdata, $response);
            foreach ($response->data as $entry) {
                $data[] = $entry;
            }
            $this->uri = $orig_uri;
        }

        return $data;
    }
protected function processTogglResponse($response)
    {
        // We only need to do something if results are paginated
        if ($response->total_count <= 50) {
            return $response->data;
        }

        $reqdata = [];
        $reqdata = json_encode($reqdata);
        $pages = ceil($response->total_count / 50);
        $curr_page = 1;
        $data = $response->data;

        $orig_uri = $this->uri;

        while ($curr_page < $pages) {
            $curr_page++;
            $this->uri .= '&page=' . $curr_page;
            $response = $this->processRequest($reqdata, self::GET);
            $this->_handleError($reqdata, $response);
            foreach ($response->data as $entry) {
                $data[] = $entry;
            }
            $this->uri = $orig_uri;
        }

        return $data;
    }
protected function processTogglResponse ( $ response ) { // We only need to do something if results are paginated if ( $ response -> total_count <= 50 ) { return $ response -> data ; } $ reqdata = [ ] ; $ reqdata = json_encode ( $ reqdata ) ; $ pages = ceil ( $ response -> total_count / 50 ) ; $ curr_page = 1 ; $ data = $ response -> data ; $ orig_uri = $ this -> uri ; while ( $ curr_page < $ pages ) { $ curr_page ++ ; $ this -> uri .= '&page=' . $ curr_page ; $ response = $ this -> processRequest ( $ reqdata , self :: GET ) ; $ this -> _handleError ( $ reqdata , $ response ) ; foreach ( $ response -> data as $ entry ) { $ data [ ] = $ entry ; } $ this -> uri = $ orig_uri ; } return $ data ; }
Process the response from Toggl to create a TimeEntry object

@param array $response API response

@return array
Process the response from Toggl to create a TimeEntry object