eZPublishCommunityProject  2013.9
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger Class Reference

Class PersistenceCachePurger. More...

+ Inheritance diagram for eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger:
+ Collaboration diagram for eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger:

Public Member Functions

 __construct (CacheServiceDecorator $cache, LocationHandlerInterface $locationHandler, LoggerInterface $logger)
 Setups current handler with everything needed. More...
 
 all ()
 Clear all persistence cache. More...
 
 clear ($cacheDir)
 Clears any caches necessary. More...
 
 content ($locationIds=null)
 Clear all content persistence cache, or by locationIds (legacy content/cache mechanism is location based). More...
 
 contentType ($id=null)
 Clear all contentType persistence cache, or by id. More...
 
 contentTypeGroup ($id=null)
 Clear all contentTypeGroup persistence cache, or by id. More...
 
 isAllCleared ()
 Returns true if all cache has been cleared already. More...
 
 isEnabled ()
 Checks if cache purger is enabled or not. More...
 
 languages ($ids)
 Clear all language persistence cache, or by id. More...
 
 resetAllCleared ()
 Reset 'allCleared' flag. More...
 
 section ($id=null)
 Clear all section persistence cache, or by id. More...
 
 setIsEnabled ($isEnabled)
 Enables or disables cache purger. More...
 
 user ($id=null)
 Clear all user persistence cache. More...
 

Protected Attributes

 $allCleared = false
 
 $cache
 
 $isEnabled = true
 
 $locationHandler
 
 $logger
 

Detailed Description

Constructor & Destructor Documentation

eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::__construct ( CacheServiceDecorator  $cache,
LocationHandlerInterface  $locationHandler,
LoggerInterface  $logger 
)

Setups current handler with everything needed.

Parameters
\eZ\Publish\Core\Persistence\Cache\CacheServiceDecorator$cache
\eZ\Publish\SPI\Persistence\Content\Location\Handler$locationHandler
\Psr\Log\LoggerInterface$logger

Member Function Documentation

eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::all ( )

Clear all persistence cache.

Sets a internal flag 'allCleared' to avoid clearing cache several times

Referenced by eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger\clear().

eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::clear (   $cacheDir)

Clears any caches necessary.

Parameters
string$cacheDirThe cache directory.
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::content (   $locationIds = null)

Clear all content persistence cache, or by locationIds (legacy content/cache mechanism is location based).

Either way all location and urlAlias cache is cleared as well.

Parameters
int|int[]|null$locationIds Ids of location we need to purge content cache for. Purges all content cache if null
Returns
array|int|[]|null
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentTypeOn invalid $id type
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::contentType (   $id = null)

Clear all contentType persistence cache, or by id.

Parameters
int | null$idPurges all contentType cache if null
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentTypeOn invalid $id type
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::contentTypeGroup (   $id = null)

Clear all contentTypeGroup persistence cache, or by id.

Either way, contentType cache is also cleared as it contains the relation to contentTypeGroups

Parameters
int | null$idPurges all contentTypeGroup cache if null
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentTypeOn invalid $id type
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::isAllCleared ( )

Returns true if all cache has been cleared already.

Returns the internal flag 'allCleared' that avoids clearing cache several times

Returns
bool
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::languages (   $ids)

Clear all language persistence cache, or by id.

Parameters
array | int$ids
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::resetAllCleared ( )

Reset 'allCleared' flag.

Resets the internal flag 'allCleared' that avoids clearing cache several times

eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::section (   $id = null)

Clear all section persistence cache, or by id.

Parameters
int | null$idPurges all section cache if null
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentTypeOn invalid $id type
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::setIsEnabled (   $isEnabled)

Enables or disables cache purger.

Disabling the cache purger might be useful in certain situations (like setup wizard where legacy cache is cleared but everything is not set yet to correctly clear SPI cache).

Parameters
bool$isEnabled
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::user (   $id = null)

Clear all user persistence cache.

Parameters
int | null$idPurges all users cache if null
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentTypeOn invalid $id type

Member Data Documentation

eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::$allCleared = false
protected
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::$cache
protected
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::$isEnabled = true
protected
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::$locationHandler
protected
eZ\Bundle\EzPublishLegacyBundle\Cache\PersistenceCachePurger::$logger
protected

The documentation for this class was generated from the following file: