src/acdhOeaw/schema/redmine/Redmine.php
static protected function redmineFetchLoop(Fedora $fedora,
                                               bool $progressBar,
                                               string $endpoint, string $param): array {
        if ($progressBar) {
            $pb = new ProgressBar(null, 10);
        }
        $class   = get_called_class();
        $objects = [];
        $offset  = 0;
        do {
            $flag = false;
            $url  = RC::get('redmineApiUrl') . '/' . $endpoint . '.json?offset=' . $offset . '&' . $param;
            $data = file_get_contents($url);
            if ($data) {
                $data = json_decode($data);
                foreach ($data->$endpoint as $i) {
                    $objects[] = new $class($fedora, $class::redmineId2repoId($i->id), (array) $i);
                    if ($progressBar) {
                        $pb->next();
                    }
                }
                $flag   = $data->offset + $data->limit < $data->total_count;
                $offset += $data->limit;
            }
        } while ($flag);
        if ($progressBar) {
            $pb->finish();
        }
        return $objects;
    }
static protected function redmineFetchLoop(Fedora $fedora,
                                               bool $progressBar,
                                               string $endpoint, string $param): array {
        if ($progressBar) {
            $pb = new ProgressBar(null, 10);
        }
        $class   = get_called_class();
        $objects = [];
        $offset  = 0;
        do {
            $flag = false;
            $url  = RC::get('redmineApiUrl') . '/' . $endpoint . '.json?offset=' . $offset . '&' . $param;
            $data = file_get_contents($url);
            if ($data) {
                $data = json_decode($data);
                foreach ($data->$endpoint as $i) {
                    $objects[] = new $class($fedora, $class::redmineId2repoId($i->id), (array) $i);
                    if ($progressBar) {
                        $pb->next();
                    }
                }
                $flag   = $data->offset + $data->limit < $data->total_count;
                $offset += $data->limit;
            }
        } while ($flag);
        if ($progressBar) {
            $pb->finish();
        }
        return $objects;
    }
static protected function redmineFetchLoop ( Fedora $ fedora , bool $ progressBar , string $ endpoint , string $ param ) : array { if ( $ progressBar ) { $ pb = new ProgressBar ( null , 10 ) ; } $ class = get_called_class ( ) ; $ objects = [ ] ; $ offset = 0 ; do { $ flag = false ; $ url = RC :: get ( 'redmineApiUrl' ) . '/' . $ endpoint . '.json?offset=' . $ offset . '&' . $ param ; $ data = file_get_contents ( $ url ) ; if ( $ data ) { $ data = json_decode ( $ data ) ; foreach ( $ data -> $ endpoint as $ i ) { $ objects [ ] = new $ class ( $ fedora , $ class :: redmineId2repoId ( $ i -> id ) , ( array ) $ i ) ; if ( $ progressBar ) { $ pb -> next ( ) ; } } $ flag = $ data -> offset + $ data -> limit < $ data -> total_count ; $ offset += $ data -> limit ; } } while ( $ flag ) ; if ( $ progressBar ) { $ pb -> finish ( ) ; } return $ objects ; }
Fetches all objects from a given Redmine API endpoint.

Redmine limits number of results returned by one API call to 100
therefore it may be needed to call the API many times.
@param Fedora $fedora
@param bool $progressBar
@param string $endpoint
@param string $param
@return array
Fetches all objects from a given Redmine API endpoint .