title: ZF2 How to get last insert id value?
body: <p>I am stuck with getting last insert id with Zend framework 2 and I gave up on this...</p>
  
  <p>There are tried combinations:</p>
  
  <pre><code>var_dump($this-&gt;tableGateway-&gt;insert($insert));
  var_dump($this-&gt;tableGateway-&gt;lastInsertValue);
  var_dump($this-&gt;tableGateway-&gt;getLastInsertValue());
  var_dump($this-&gt;tableGateway-&gt;getAdapter()-&gt;getDriver()-&gt;getConnection()-&gt;getLastGeneratedValue());
  </code></pre>
  
  <p>Value is inserting to table, but every line (except first, which gives int "1") returns null. Please don't tell me, that such a big framework does not give possibility to get last insert id value!?</p>