title: How do you access Doctrine DBAL in a Symfony2 service class?
body: <p>I'm learning Symfony2 (and OOP) and want to create a service that's available throughout my app.  This service takes a value foo, checks it against a database table, and returns a value bar.</p>
  
  <p>I have a little class</p>
  
  <pre><code>namespace Acme\TestBundle\Toolbox;
  
  class StringToolbox
  {
      public function lookupSomething($foo)
     {
  
          $conn = $this-&gt;get('database_connection');
          $sql = "SELECT bar FROM bar_list WHERE foo = :foo";
          $stmt = $conn-&gt;prepare($sql);
          $stmt-&gt;bindValue("foo", $foo);
          $stmt-&gt;execute();
  
  
          return $bar;
      }
  
  
  }
  </code></pre>
  
  <p>My settings are: </p>
  
  <pre><code>services:
      toolbox:
         class:        Acme\TestBundle\Toolbox
          arguments:   [@database_connection]
  </code></pre>
  
  <p>But it throws an error saying that the get() method is undefined.  I'm stuck-- how can I use DBAL in the service?  Thanks! </p>