title: EntityRepository not found
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/11338256/doctrine-error-class-doctrine-orm-entityrepository-not-found">Doctrine error: Class &#39;Doctrine\ORM\EntityRepository&#39; not found</a>  </p>
  </blockquote>
  
  
  
  <p>I'm new in Doctrine, I'm following the examples in the documentation. I created my entities and everything is working fine until I created a Repository. I have an entity called User and a UserRepository.</p>
  
  <p>But when I try to use the User repository I get the error message: <strong>Fatal error: Class 'Doctrine\ORM\EntityRepository' not found in C:\xampp\htdocs\excap\repositories\UserRepository.php on line 10</strong></p>
  
  <pre><code>use Doctrine\ORM\EntityRepository;
  
  /**
   * Description of UserRepository
   *
   * @author Mario
   */
  class UserRepository extends EntityRepository
  { 
  </code></pre>
  
  <p>How can I solved this?</p>
  
  <pre><code>&lt;?php
  //bootstrap_doctrine.php
  $isDevMode = true;
  use Doctrine\ORM\Tools\Setup;
  require_once 'vendor/autoload.php';
  
  $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__.'/entities'), $isDevMode);
  $conn = array(
      'driver' =&gt; 'pdo_mysql',
      'user' =&gt; 'mydbuser',
      'password' =&gt; 'mydbpassword',
      'dbname' =&gt; 'mydbname'
  );
  
  $entityManager = \Doctrine\ORM\EntityManager::create($conn, $config);
  ?&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;?php
  //boostrap.php
  //Entities
  require_once 'entities/User.php';
  require_once 'entities/Gender.php';
  require_once 'entities/AccessPoint.php';
  
  //Repositories
  require_once 'repositories/UserRepository.php';
  
  if(!class_exists("Doctrine\Common\Version", FALSE))
  {
      require_once 'bootstrap_doctrine.php';
  }
  ?&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;?php
  // autoload.php generated by Composer
  if (!class_exists('Composer\\Autoload\\ClassLoader', false)) {
      require __DIR__ . '/composer' . '/ClassLoader.php';
  }
  
  return call_user_func(function() {
      $loader = new \Composer\Autoload\ClassLoader();
      $composerDir = __DIR__ . '/composer';
  
      $map = require $composerDir . '/autoload_namespaces.php';
      foreach ($map as $namespace =&gt; $path) {
          $loader-&gt;add($namespace, $path);
      }
  
      $classMap = require $composerDir . '/autoload_classmap.php';
      if ($classMap) {
          $loader-&gt;addClassMap($classMap);
      }
  
      $loader-&gt;register();
  
      return $loader;
  });
  
  ?&gt;
  </code></pre>