Det viser sig, at standard Doctrin config opsætning [1] ikke virker med min kodebase, eller nogen kodebase, jeg har testet med, måske er dokumenterne forældede. Efter at have pløjet gennem Interwebs i timevis, er dette den konfiguration, der endelig fik det til at fungere for mig:
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\Common\Annotations\AnnotationReader;
$paths = array( realpath(__DIR__."/../src/My/Entity") );
$isDevMode = TRUE;
// the connection configuration
$dbParams = array(
'driver' => 'pdo_mysql',
'user' => 'myuser',
'password' => 's3cr3t',
'dbname' => 'mydb',
);
$cache = new \Doctrine\Common\Cache\ArrayCache();
$reader = new AnnotationReader();
$driver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, $paths);
$config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
$config->setMetadataCacheImpl( $cache );
$config->setQueryCacheImpl( $cache );
$config->setMetadataDriverImpl( $driver );
$entityManager = EntityManager::create($dbParams, $config);
//-- This I had to add to support the Mysql enum type.
$platform = $entityManager->getConnection()->getDatabasePlatform();
$platform->registerDoctrineTypeMapping('enum', 'string');
[1] http://docs.doctrine-project. org/da/latest/tutorials/getting-started.html