/**
  * Creates the entity manager for the application.
  *
  * @param Configuration $config
  * @param string        $modelPath
  * @return AnnotationDriver
  */
 public function factory(Configuration $config, $modelPath)
 {
     $annotationDriver = new AnnotationDriver($config->getAnnotationsReader(), array($modelPath, $config->getAttributeDir()));
     // create a driver chain for metadata reading
     $driverChain = new MappingDriverChain();
     // register annotation driver for our application
     $driverChain->addDriver($annotationDriver, 'Shopware\\Models\\');
     $driverChain->addDriver($annotationDriver, 'Shopware\\CustomModels\\');
     $config->setMetadataDriverImpl($driverChain);
     return $annotationDriver;
 }