title: BigQuery PHP Call to undefined method Google_Client::setAssertionCredentials()
body: <p>So basically I tried <a href="https://stackoverflow.com/questions/12413717/bigquery-php-examples">this</a> from the second answer, but it comes with an error</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined method
    Google_Client::setAssertionCredentials() in</p>
  </blockquote>
  
  <p>Here's my code</p>
  
  <pre><code>require_once 'xxx/vendor/autoload.php';
  public function createGClient() {
      define("CLIENT_ID", "xxx.apps.googleusercontent.com");
      define("SERVICE_ACCOUNT_NAME","xxx@xxx.ccc");
      define("KEY_FILE",'xxx');
  
      define("PROJECT_ID","xxx");
      define("DATASET_ID","xxx");
      define("TABLE_ID","xxx");
  
      $this-&gt;client = new Google_Client();
      $this-&gt;client-&gt;setApplicationName("Test");  
  
      $key = file_get_contents(KEY_FILE);
      $this-&gt;client-&gt;setAssertionCredentials(
      Google_Auth_AssertionCredentials(SERVICE_ACCOUNT_NAME,
  array('https://www.googleapis.com/auth/bigquery'), $key, "notasecret"));
      $this-&gt;client-&gt;setClientId(CLIENT_ID);
      $this-&gt;service = new Google_Service_Bigquery($this-&gt;client);
  }
  
  public function runQuery() {
      // To see the a list of tables  
      print_r($this-&gt;service-&gt;tables-&gt;listTables(PROJECT_ID, DATASET_ID));
  
      // To see details of a table
      print_r($this-&gt;service-&gt;tables-&gt;get(PROJECT_ID, DATASET_ID, TABLE_ID));
  
      // To query a table
      $jobs = $this-&gt;service-&gt;jobs;
      $query = new Google_Service_Bigquery_QueryRequest();
      $query-&gt;setQuery("SELECT * FROM wherever;");
      $response = $jobs-&gt;query(PROJECT_ID, $query);
      print_r($response);
  }
  </code></pre>
  
  <p>I already install everything from the guide/doc. Can someone help me because I tried everything and it doesnt work, thanks a lot.</p>