php bin/console doctrine:cache:clear-collection-region
Clear a second-level cache collection region.
Usage
doctrine:cache:clear-collection-region [--all] [--flush] [--em [EM]] [--] [<owner-class>] [<association>] [<owner-id>]
Arguments
owner-class The owner entity name.
association The association collection name.
owner-id The owner identifier.
Options
--all If defined, all entity regions will be deleted/invalidated.
--flush If defined, all cache entries will be flushed.
--em The entity manager to use for this command
Help
The doctrine:cache:clear-collection-region command is meant to clear a second-level cache collection regions for an associated Entity Manager.
It is possible to delete/invalidate all collection region, a specific collection region or flushes the cache provider.
The execution type differ on how you execute the command.
If you want to invalidate all entries for an collection region this command would do the work:
doctrine:cache:clear-collection-region 'Entities\MyEntity' 'collectionName'
To invalidate a specific entry you should use :
doctrine:cache:clear-collection-region 'Entities\MyEntity' 'collectionName' 1
If you want to invalidate all entries for the all collection regions:
doctrine:cache:clear-collection-region --all
Alternatively, if you want to flush the configured cache provider for an collection region use this command:
doctrine:cache:clear-collection-region 'Entities\MyEntity' 'collectionName' --flush
Finally, be aware that if --flush option is passed,
not all cache providers are able to flush entries, because of a limitation of its execution nature.