title: Why doesn't Doctrine 2 find my entities?
body: <p>I'm trying to learn about using <a href="http://www.doctrine-project.org/" rel="nofollow">Doctrine 2</a> by making a very simple script which fetches information from my database. The problem is that I can't find any documentation explaining how Doctrine finds and uses my mapping entities. And so when it complains that it's not finding an entity, I don't know what to do to solve the problem. Consider the following structure in my www folder:</p>
  
  <ul>
  <li>Doctrine/</li>
  <li>Entities/</li>
  <li><ul>
  <li>person.php</li>
  </ul></li>
  <li>myTestPage.php</li>
  </ul>
  
  <p><strong>person.php</strong></p>
  
  <pre><code>&lt;?php
  
  /** @Entity @Table(name="person")*/
  class person
  {
      /**
       * @Id @Column(type="integer")
       */
      protected $uid;
  }
  ?&gt;
  </code></pre>
  
  <p><strong>myTestPage.php</strong></p>
  
  <pre><code>&lt;?php
      require "Doctrine/Doctrine/ORM/Tools/Setup.php";
  
      $lib = "Doctrine";
      Doctrine\ORM\Tools\Setup::registerAutoloadDirectory($lib);
  
      use Doctrine\ORM\Tools\Setup,
          Doctrine\ORM\EntityManager;
  
      $paths = array("/Entities");
  
      $isDevMode = true;
  
      $dbParams = array("driver" =&gt; "pdo_mysql",
          "host" =&gt; "myhost.ca",
          "user" =&gt; "Shawn",
          "password" =&gt; "noneofyourbusiness",
          "dbname" =&gt; "testDB");
  
      $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
      $em = EntityManager::create($dbParams, $config);
  
      $qb = $em-&gt;createQueryBuilder();
      $qb-&gt;select(array('uid'))
          -&gt;from('person', 't');
      $query = $qb-&gt;getQuery();
  
      $result = $query-&gt;getResult();
      echo $result;
  ?&gt;
  </code></pre>
  
  <p>When I visit myTestPage.php, I get the following error message: </p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'Doctrine\ORM\Query\QueryException'
    with message '[Semantical Error] line 0, col 24 near 'person':
    Error: Class 'person' is not defined.' in
    C:\wamp\www\Doctrine\Doctrine\ORM\Query\QueryException.php on line 47</p>
  </blockquote>
  
  <p>The problem seems to be that Doctrine can't find person.php, but how can I solve this?</p>