Hi,

I have already asked the question at stack overflow.

But I think I get faster and better answers here.


I have now run out of ideas and Google is not helping either. I believe the 
issue is rather simple to solve, but currently I am not seeing why it 
happens. Everything works fine on my testing environment with dev mode. 

But doesn't work on production where the dev mode is off and proxy files 
need to be generated manually.

The first time I generated proxy files on the production environment, 
everything worked fine. Now I needed to improve some of the entities and 
when I use the "doctrine orm:generate-proxies" command again, then all the 
proxy files get generated and when I look at the new entity proxy files, 
then I can see that the new column are mapped. 

But when I try to save or load new object, then nothing gets saved or load 
to the new columns. It is as if doctrine 2 doesn't understand, that there 
are new proxy files that it should use. Instead, it keeps on using some 
other hidden old proxy files, cached away in some dark end.

Any idea why doctrine 2 doesn't use the newly generated proxy files?

For extra clarity, this the the Doctrine Initialisation code.

    $paths = array(__DIR__ . '/../ORM/Definition/Doctrine2/Entity');
    
            $isDevMode = false;
            $autoGenerateProxyClasses = 
AbstractProxyFactory::AUTOGENERATE_NEVER;
    
            if ($this->serverDevelopment()) {
                $isDevMode = true;
                $autoGenerateProxyClasses = 
AbstractProxyFactory::AUTOGENERATE_ALWAYS;
            }
    
            $dbParams = array(
                'driver' => 'pdo_mysql',
                'user' => 'REMOVE',
                'password' => 'REMOVE',
                'dbname' => 'REMOVE',
                'host' => 'REMOVE'
            );
    
            $config = Setup::createAnnotationMetadataConfiguration($paths, 
$isDevMode);
            $config->setProxyDir(__DIR__ . 
'/../ORM/Definition/Doctrine2/Entity/Proxy');
            
$config->setProxyNamespace('Database\ORM\Definition\Doctrine2\Entity\Proxy');
            $config->setAutoGenerateProxyClasses($autoGenerateProxyClasses);
    
            $this->entityManager = EntityManager::create($dbParams, 
$config);

Any help would be appreciated.

Thanks,
Hendrik

-- 
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 https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to