title: Access Database Adapter in Zend Framework 2 from a Model
body: <p>i am new to Zf2, and i want to know how can i access the database Adapter in Zend Framework 2 from a Model ?
  If i am working inside a model, and i want to fetch the db adapter ?
  how ?</p>
  
  <p>i tried </p>
  
  <pre><code>use Zend\Db;
  use Zend\Db\TableGateway\TableGateway;
  use Zend\Db\Adapter\Adapter;
  
  $dbAdapter = $this-&gt;getServiceLocator()-&gt;get('Zend\Db\Adapter\Adapter');
  $adapter = new Adapter(); 
  </code></pre>
  
  <p>but does not work !
  I will be glad if you give me some examples .</p>
  
  <p>Tarek</p>