‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Cache\Backend\BackendInterface Interface Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\Backend\BackendInterface:
TYPO3\CMS\Core\Cache\Backend\AbstractBackend TYPO3\CMS\Core\Cache\Backend\FreezableBackendInterface TYPO3\CMS\Core\Cache\Backend\PhpCapableBackendInterface TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface TYPO3\CMS\Core\Cache\Backend\TransientBackendInterface TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\BackendFixture TYPO3\CMS\Core\Cache\Backend\ApcuBackend TYPO3\CMS\Core\Cache\Backend\MemcachedBackend TYPO3\CMS\Core\Cache\Backend\NullBackend TYPO3\CMS\Core\Cache\Backend\RedisBackend TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend TYPO3\CMS\Core\Tests\Unit\Cache\Backend\Fixtures\ConcreteBackendFixture TYPO3\CMS\Core\Cache\Backend\FileBackend TYPO3\CMS\Core\Cache\Backend\NullBackend TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend TYPO3\CMS\Core\Cache\Backend\ApcuBackend TYPO3\CMS\Core\Cache\Backend\FileBackend TYPO3\CMS\Core\Cache\Backend\MemcachedBackend TYPO3\CMS\Core\Cache\Backend\NullBackend TYPO3\CMS\Core\Cache\Backend\RedisBackend TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend TYPO3\CMS\Core\Cache\Backend\ApcuBackend TYPO3\CMS\Core\Cache\Backend\MemcachedBackend TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\BackendConfigurationOptionFixture TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\BackendDefaultFixture TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\BackendInitializeObjectFixture

Public Member Functions

 setCache (FrontendInterface $cache)
 
 set ($entryIdentifier, $data, array $tags=[], $lifetime=null)
 
mixed get ($entryIdentifier)
 
bool has ($entryIdentifier)
 
bool remove ($entryIdentifier)
 
 flush ()
 
 collectGarbage ()
 

Detailed Description

A contract for a Cache Backend

Definition at line 24 of file BackendInterface.php.

Member Function Documentation

◆ collectGarbage()

◆ flush()

◆ get()

mixed TYPO3\CMS\Core\Cache\Backend\BackendInterface::get (   $entryIdentifier)

◆ has()

◆ remove()

bool TYPO3\CMS\Core\Cache\Backend\BackendInterface::remove (   $entryIdentifier)

Removes all cache entries matching the specified identifier. Usually this only affects one entry but if - for what reason ever - old entries for the identifier still exist, they are removed as well.

Parameters
string$entryIdentifier‪Specifies the cache entry to remove
Returns
‪bool TRUE if (at least) an entry could be removed or FALSE if no entry was found

Implemented in TYPO3\CMS\Core\Cache\Backend\RedisBackend, TYPO3\CMS\Core\Cache\Backend\MemcachedBackend, TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend, TYPO3\CMS\Core\Cache\Backend\FileBackend, TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend, TYPO3\CMS\Core\Cache\Backend\ApcuBackend, TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend, TYPO3\CMS\Core\Cache\Backend\NullBackend, TYPO3\CMS\Core\Tests\Unit\Cache\Backend\Fixtures\ConcreteBackendFixture, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\BackendFixture.

◆ set()

TYPO3\CMS\Core\Cache\Backend\BackendInterface::set (   $entryIdentifier,
  $data,
array  $tags = [],
  $lifetime = null 
)

Saves data in the cache.

Parameters
string$entryIdentifier‪An identifier for this specific cache entry
string$data‪The data to be stored
array$tags‪Tags to associate with this cache entry. If the backend does not support tags, this option can be ignored.
int$lifetime‪Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.
Exceptions

Implemented in TYPO3\CMS\Core\Cache\Backend\RedisBackend, TYPO3\CMS\Core\Cache\Backend\MemcachedBackend, TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend, TYPO3\CMS\Core\Cache\Backend\FileBackend, TYPO3\CMS\Core\Cache\Backend\ApcuBackend, TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend, TYPO3\CMS\Core\Cache\Backend\TransientMemoryBackend, TYPO3\CMS\Core\Cache\Backend\NullBackend, TYPO3\CMS\Core\Tests\Unit\Cache\Backend\Fixtures\ConcreteBackendFixture, and TYPO3\CMS\Core\Tests\Unit\Cache\Fixtures\BackendFixture.

◆ setCache()

TYPO3\CMS\Core\Cache\Backend\BackendInterface::setCache ( FrontendInterface  $cache)