public function download($reportFile, ReportRequest $reportRequest, $retryInterval = null)
    {
        try {
            $this->waitReady($reportRequest, $retryInterval ?: 0, [
                RequestOptions::SINK => $reportFile,
            ]);
        } catch (\Exception $ex) {
            if (is_file($reportFile) && is_writable($reportFile)) {
                if (false !== $fh = fopen($reportFile, 'w')) {
                    ftruncate($fh, 0);
                    fclose($fh);
                }
            }

            throw $ex;
        }
    }
public function download($reportFile, ReportRequest $reportRequest, $retryInterval = null)
    {
        try {
            $this->waitReady($reportRequest, $retryInterval ?: 0, [
                RequestOptions::SINK => $reportFile,
            ]);
        } catch (\Exception $ex) {
            if (is_file($reportFile) && is_writable($reportFile)) {
                if (false !== $fh = fopen($reportFile, 'w')) {
                    ftruncate($fh, 0);
                    fclose($fh);
                }
            }

            throw $ex;
        }
    }
public function download ( $ reportFile , ReportRequest $ reportRequest , $ retryInterval = null ) { try { $ this -> waitReady ( $ reportRequest , $ retryInterval ? : 0 , [ RequestOptions :: SINK => $ reportFile , ] ) ; } catch ( \ Exception $ ex ) { if ( is_file ( $ reportFile ) && is_writable ( $ reportFile ) ) { if ( false !== $ fh = fopen ( $ reportFile , 'w' ) ) { ftruncate ( $ fh , 0 ) ; fclose ( $ fh ) ; } } throw $ ex ; } }
Downloads and save report to the specified file.

@param string        $reportFile    The path to report file
@param ReportRequest $reportRequest The report request
@param int|null      $retryInterval An amount of delay between requests, in seconds

@throws ApiException
@throws NetworkException
@throws ReportDefinitionException
@throws \Exception
Downloads and save report to the specified file .