php bin/console doctrine:cache:clear-entity-region

Clear a second-level cache entity region.

Usage

doctrine:cache:clear-entity-region [--all] [--flush] [--em [EM]] [--] [<entity-class>] [<entity-id>]

Arguments

entity-class   The entity name. 
entity-id      The entity 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-entity-region command is meant to clear a second-level cache entity region for an associated Entity Manager.
It is possible to delete/invalidate all entity region, a specific entity 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 entity region this command would do the work:

doctrine:cache:clear-entity-region 'Entities\MyEntity'

To invalidate a specific entry you should use :

doctrine:cache:clear-entity-region 'Entities\MyEntity' 1

If you want to invalidate all entries for the all entity regions:

doctrine:cache:clear-entity-region --all

Alternatively, if you want to flush the configured cache provider for an entity region use this command:

doctrine:cache:clear-entity-region 'Entities\MyEntity' --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.