Symfony2 doctrine clear cache
app/console
will list how you can do it
app/console doctrine:cache:clear-metadata app/console doctrine:cache:clear-query app/console doctrine:cache:clear-result
for symfony 3+:
php bin/console
and list of comand (for copy/past from project directory):
php bin/console doctrine:cache:clear-metadata php bin/console doctrine:cache:clear-query php bin/console doctrine:cache:clear-result
If you want to do it within your code (from Doctrine's documentation) :
If you simply want to delete all cache entries you can do so with the deleteAll() method.
<?php $cacheDriver = new \Doctrine\Common\Cache\ArrayCache(); $deleted = $cacheDriver->deleteAll();