src/Big.php
/**
     * Wrap around Google's BigQuery run method and handle results
     *
     * @param string $query
     * @param array|null $options
	 * @param boolean $bReturn (determine if the function need to return data)
     *
     * @return \Illuminate\Support\Collection
     */
Wrap around Google's BigQuery run method and handle results
@param string $query
@param array|null $options
@param boolean $bReturn (determine if the function need to return data)

@return \Illuminate\Support\Collection
Wrap around Google ' s BigQuery run method and handle results @param string $query @param array|null $options @param boolean $bReturn ( determine if the function need to return data ) @return \ Illuminate \ Support \ Collection
public function run($query, $options = null, $bReturn = true)
    {
        $options = $options ?? $this->options;
        $queryResults = $this->query->runQuery($this->query->query($query, $options));
        $isComplete = $queryResults->isComplete();
        while (!$isComplete) {
            sleep(.5); 
            $queryResults->reload(); 
            $isComplete = $queryResults->isComplete(); 
        }
		if ($bReturn){
			$data = array();
			foreach ($queryResults->rows() as $row) {
				$data[] = $row;
			}
			return collect($data ?? []);
		}
    }
public function run ( $ query , $ options = null , $ bReturn = true ) { $ options = $ options ?? $ this -> options ; $ queryResults = $ this -> query -> runQuery ( $ this -> query -> query ( $ query , $ options ) ) ; $ isComplete = $ queryResults -> isComplete ( ) ; while ( ! $ isComplete ) { sleep ( .5 ) ; $ queryResults -> reload ( ) ; $ isComplete = $ queryResults -> isComplete ( ) ; } if ( $ bReturn ) { $ data = array ( ) ; foreach ( $ queryResults -> rows ( ) as $ row ) { $ data [ ] = $ row ; } return collect ( $ data ?? [ ] ) ; } }
Wrap around Google's BigQuery run method and handle results
 @param string $query
 @param array|null $options
 @param boolean $bReturn (determine if the function need to return data)
Wrap around Google ' s BigQuery run method and handle results @param string $query @param array|null $options @param boolean $bReturn ( determine if the function need to return data )
// Set default options if nothing is passed in // Setup our result checks // let's wait for a moment... // trigger a network request // check the query's status // Mutate into a laravel collection