On Sunday, 2 February 2014 20:20:24 UTC+1, Parsifal wrote:
>
> As you see here:
> $driver = new StaticPHPDriver('/path/to/entities');
> $em->getConfiguration()->setMetadataDriverImpl($driver);
> EntityManager should already be set prior to this because of $em. 
>  
> So how can I set PHP as metadrive as second param, instead of this 
> annotation one?
> $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
> $em = Doctrine\ORM\EntityManager::create($dbParams, $config, $evm);
>

I'd say the example with $em->getConfiguration() is based on adding mapping 
through PHP while an entitimanager already exists (made with another 
driver). To define a Configuration with a PHP-driver before the 
entittymanager has been defined you'll have to do something like this:

$config = new Configuration;

// $config->setAllKindsOfAttributesLikeCacheProxyDirEtc...bladibla; 
// See 
http://docs.doctrine-project.org/en/latest/reference/advanced-configuration.html

*$driverImpl = new PHPDriver('/path/to/php/mapping/files');
$config->setMetadataDriverImpl($driverImpl);*
//set connectionoptions... see documentation

$em = EntityManager::create($connectionOptions, $config);


-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to