title: Symfony + MongoDB driver issue
body: <p>I'm following <a href="https://symfony.com/doc/current/bundles/DoctrineMongoDBBundle/index.html" rel="nofollow noreferrer">this</a> tutorial, but Symfony doesn't seem to find the <code>MongoId</code> class. </p>
  
  <pre><code>{
      "message": "Attempted to load class \"MongoId\" from the global namespace.\nDid you forget a \"use\" statement?",
      "class": "Symfony\\Component\\Debug\\Exception\\ClassNotFoundException",
      "trace": [
        {
          "namespace": "",
          "short_class": "",
          "class": "",
          "type": "",
          "function": "",
          "file": "/home/local/BROCELIA/kha/dev/symfonyTraining/rest/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/Id/AutoGenerator.php",
          "line": 34,
          "args": []
        },
        ...
      ]
  }
  </code></pre>
  
  <p>Here's my Document:</p>
  
  <pre><code>&lt;?php
  
  namespace Acme\StoreBundle\Document;
  use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;
  
  /**
   * @MongoDB\Document
   */
  class Product
  {
  /**
   * @MongoDB\Id
   */
  protected $id;
  
  /**
   * @MongoDB\Field(type="string")
   */
  protected $name;
  
  /**
   * @MongoDB\Field(type="float")
   */
  protected $price;
  
  public function getId() {
      return $this-&gt;id;
  }
  
  public function setName($name) {
      $this-&gt;name = $name;
      return $this;
  }
  
  public function getName() {
      return $this-&gt;name;
  }
  
  public function setPrice($price) {
      $this-&gt;price = $price;
      return $this;
  }
  
  public function getPrice() {
      return $this-&gt;price;
  }
  }
  </code></pre>
  
  <p>And here's my Controller: (NB: I'm using PhPStorm and it doesn't seem to find the <code>persist()</code> and <code>flush()</code> methods either. Don't know how it could be related though).</p>
  
  <pre><code>    &lt;?php
      namespace Acme\StoreBundle\Controller;
  
      use Acme\StoreBundle\Document\Product;
      use Symfony\Bundle\FrameworkBundle\Controller\Controller;
      use Symfony\Component\HttpFoundation\Response;
  
      class DefaultController extends Controller
      {
          public function indexAction()
          {
              return $this-&gt;render('AcmeStoreBundle:Default:index.html.twig');
          }
  
  
          public function createAction()
          {
              $product = new Product();
              $product-&gt;setName('A Foo Bar');
              $product-&gt;setPrice('19.99');
              $dm = $this-&gt;get('doctrine_mongodb')-&gt;getManager();
              $dm-&gt;persist($product);
              $dm-&gt;flush();
              return new Response('Created product id '.$product-&gt;getId());
          }
      }
  </code></pre>
  
  <p>My php version being <code>PHP 7.0.8-0ubuntu0.16.04.3 (cli) ( NTS )</code>. I installed the php MongoDB driver through pecl. I also added <code>extension=mongodb.so</code> at the end of my php.ini (I had two of these: <code>/etc/php/7.0/cli/php.ini</code> and <code>/etc/php/7.0/fpm/php.ini</code>, I added it in both). <code>php -r "phpinfo();" | grep "mongo"</code> outputs this: </p>
  
  <pre><code>mongodb
  mongodb support =&gt; enabled
  mongodb version =&gt; 1.1.9
  mongodb stability =&gt; stable
  libmongoc version =&gt; 1.3.6
  mongodb.debug =&gt; no value =&gt; no value
  </code></pre>
  
  <p>So I'm guessing the driver is installed. Although there's no such thing as mongodb.ini (or even mongo.ini) in the output of php --ini;</p>
  
  <pre><code>Configuration File (php.ini) Path: /etc/php/7.0/cli
  Loaded Configuration File:         /etc/php/7.0/cli/php.ini
  Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
  Additional .ini files parsed:      
  /etc/php/7.0/cli/conf.d/10-mysqlnd.ini,
  ... Lots of .ini but nothing mongo-related.
  </code></pre>
  
  <p>4 hours and still no idea of where I messed up. I tried and reinstalled the mongodb driver, php and pecl several times, in vain. The other posts on SO asking for this seem to have fixed their issues by a simple reinstall of the driver. Sadly wasn't my case, plus I'm new into symfony.</p>