This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

How to clear the doctrine cache?

New topics about Symfony 2 should go here

How to clear the doctrine cache?

by simohammedhttc » Sun Apr 05, 2015 7:19 am

Hi,

I accidentally tried adding an entity that contains the "age" field of type "radio".

php app/console generate:doctrine:entity --no-interaction --entity=FooBundle:Bar --fields="age:radio ....."

I know that no "radio" type column is available. For that reason I got the error :

Unknown column type "radio" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the known types with \Doctrine\DBAL\Types\Type::getTypesMap().

If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type.

Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type name is empty you might have a problem with the cache or forgot some mapping information.

The problem is that I still get this error even after correcting the fields, I can bet that the erroneous metadata are cached, I tried to remove them but in vain:

I tried all the commands:

doctrine:cache:clear-metadata
doctrine:cache:clear-query
doctrine:cache:clear-result

I am using PHP 5.5.8, Zend OPcache is disabled, no APC extension is available.

Doctrine is using Doctrine\Common\Cache\ArrayCache as cache driver.

I closed/opened my browser, I rebooted EasyPHP, cleared the symfony cache folders etc.

How can I definitely clear the doctrine cache ?
simohammedhttc
Junior Member
 
Posts: 2
Joined: Mon Jul 14, 2014 2:46 am

Re: How to clear the doctrine cache?

by karop » Sun May 17, 2015 1:16 pm

Have you tried to delete the whole cache/ folder?
How about temporarily change column name in DB, update it and then see? (Here you'll know for sure is it problem with cache or your code)
karop
Junior Member
 
Posts: 13
Joined: Tue Oct 02, 2012 4:25 pm