public function load(Resource $apiResource, $limit, $type, $startsAt)
    {
        /** @var \Platformsh\Client\Model\Environment|\Platformsh\Client\Model\Project $apiResource */
        $activities = $apiResource->getActivities($limit, $type, $startsAt);
        $progress = new ProgressBar($this->getProgressOutput());
        $progress->setMessage($type === 'environment.backup' ? 'Loading snapshots...' : 'Loading activities...');
        $progress->setFormat('%message% %current% (max: %max%)');
        $progress->start($limit);
        while (count($activities) < $limit) {
            if ($activity = end($activities)) {
                $startsAt = strtotime($activity->created_at);
            }
            $nextActivities = $apiResource->getActivities($limit - count($activities), $type, $startsAt);
            if (!count($nextActivities)) {
                break;
            }
            foreach ($nextActivities as $activity) {
                $activities[$activity->id] = $activity;
            }
            $progress->setProgress(count($activities));
        }
        $progress->clear();

        return $activities;
    }
public function load(Resource $apiResource, $limit, $type, $startsAt)
    {
        /** @var \Platformsh\Client\Model\Environment|\Platformsh\Client\Model\Project $apiResource */
        $activities = $apiResource->getActivities($limit, $type, $startsAt);
        $progress = new ProgressBar($this->getProgressOutput());
        $progress->setMessage($type === 'environment.backup' ? 'Loading snapshots...' : 'Loading activities...');
        $progress->setFormat('%message% %current% (max: %max%)');
        $progress->start($limit);
        while (count($activities) < $limit) {
            if ($activity = end($activities)) {
                $startsAt = strtotime($activity->created_at);
            }
            $nextActivities = $apiResource->getActivities($limit - count($activities), $type, $startsAt);
            if (!count($nextActivities)) {
                break;
            }
            foreach ($nextActivities as $activity) {
                $activities[$activity->id] = $activity;
            }
            $progress->setProgress(count($activities));
        }
        $progress->clear();

        return $activities;
    }
public function load ( Resource $ apiResource , $ limit , $ type , $ startsAt ) { /** @var \Platformsh\Client\Model\Environment|\Platformsh\Client\Model\Project $apiResource */ $ activities = $ apiResource -> getActivities ( $ limit , $ type , $ startsAt ) ; $ progress = new ProgressBar ( $ this -> getProgressOutput ( ) ) ; $ progress -> setMessage ( $ type === 'environment.backup' ? 'Loading snapshots...' : 'Loading activities...' ) ; $ progress -> setFormat ( '%message% %current% (max: %max%)' ) ; $ progress -> start ( $ limit ) ; while ( count ( $ activities ) < $ limit ) { if ( $ activity = end ( $ activities ) ) { $ startsAt = strtotime ( $ activity -> created_at ) ; } $ nextActivities = $ apiResource -> getActivities ( $ limit - count ( $ activities ) , $ type , $ startsAt ) ; if ( ! count ( $ nextActivities ) ) { break ; } foreach ( $ nextActivities as $ activity ) { $ activities [ $ activity -> id ] = $ activity ; } $ progress -> setProgress ( count ( $ activities ) ) ; } $ progress -> clear ( ) ; return $ activities ; }
Load activities.

@param Resource    $apiResource
@param int         $limit
@param string|null $type
@param int|null    $startsAt

@return \Platformsh\Client\Model\Activity[]
Load activities .