title: Zend Framework 2 TableGateway returning empty resultset
body: <p>I am just getting started with developing with Zend Framework 2 and I've run into a roadblock.</p>
  
  <p>At it's simplest expression, the fetchAll function works:</p>
  
  <pre><code>public function fetchAll()
  {
      $resultSet = $this-&gt;tableGateway-&gt;select();
      return $resultSet;
  }
  </code></pre>
  
  <p>However, when I attempt to mix in the join in the following way:</p>
  
  <pre><code>public function fetchAll()
  {
      $sql = new Sql($this-&gt;tableGateway-&gt;getAdapter());
  
      $select = $sql-&gt;select();
      $select-&gt;from('Entreprise')
          -&gt;columns(array('id', 'nom', 'categorie_id'))
          -&gt;join(array('C' =&gt; 'Categorie'), 'categorie_id = C.id', array('categorie' =&gt; 'nom'), \Zend\Db\Sql\Select::JOIN_INNER);
      $resultSet = $this-&gt;tableGateway-&gt;selectWith($select);
      return $resultSet;
  }
  </code></pre>
  
  <p>The resulting query is:</p>
  
  <pre><code>SELECT "Entreprise"."id" AS "id", "Entreprise"."nom" AS "nom", "Entreprise"."categorie_id" AS "categorie_id", "C"."nom" AS "categorie" FROM "Entreprise" INNER JOIN "Categorie" AS "C" ON "categorie_id" = "C"."id"
  </code></pre>
  
  <p>The table names, columns are fine since the query doesn't throw an error, but instead simply returns an empty result set. Even removing the join and just leaving the following code doesn't help.</p>
  
  <pre><code>public function fetchAll()
  {
      $sql = new Sql($this-&gt;tableGateway-&gt;getAdapter());
  
      $select = $sql-&gt;select();
      $select-&gt;from('Entreprise');
      $resultSet = $this-&gt;tableGateway-&gt;selectWith($select);
      return $resultSet;
  }
  </code></pre>
  
  <p>Which makes me believe it's simply something wrong with how I get the adapter or instantiate the select, but I just can't seem to figure it out or find any solution.</p>
  
  <p>Can anyone help me figure what I'm doing wrong?</p>