‪TYPO3CMS  9.5
TYPO3\CMS\Core\Cache\Frontend\StringFrontend Class Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\Frontend\StringFrontend:
TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend TYPO3\CMS\Core\Cache\Frontend\FrontendInterface

Public Member Functions

 __construct ($identifier, BackendInterface $backend)
 
 set ($entryIdentifier, $string, array $tags=[], $lifetime=null)
 
string get ($entryIdentifier)
 
array getByTag ($tag)
 
- ‪Public Member Functions inherited from ‪TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend
string getIdentifier ()
 
BackendInterface getBackend ()
 
bool has ($entryIdentifier)
 
bool remove ($entryIdentifier)
 
 flush ()
 
 flushByTags (array $tags)
 
 flushByTag ($tag)
 
 collectGarbage ()
 
bool isValidEntryIdentifier ($identifier)
 
bool isValidTag ($tag)
 

Additional Inherited Members

- ‪Public Attributes inherited from ‪TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
const TAG_CLASS = '%CLASS%'
 
const TAG_PACKAGE = '%PACKAGE%'
 
const PATTERN_ENTRYIDENTIFIER = '/^[a-zA-Z0-9_%\\-&]{1,250}$/'
 
const PATTERN_TAG = '/^[a-zA-Z0-9_%\\-&]{1,250}$/'
 
- ‪Protected Attributes inherited from ‪TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend
string $identifier
 
AbstractBackend TaggableBackendInterface $backend
 

Detailed Description

A cache frontend for strings. Nothing else.

Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0 - use VariableFrontend instead.

Definition at line 25 of file StringFrontend.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Cache\Frontend\StringFrontend::__construct (   $identifier,
BackendInterface  $backend 
)
Parameters
string$identifier
BackendInterface$backend

Reimplemented from TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend.

Definition at line 31 of file StringFrontend.php.

References TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\$backend, and TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\$identifier.

Member Function Documentation

◆ get()

string TYPO3\CMS\Core\Cache\Frontend\StringFrontend::get (   $entryIdentifier)

Finds and returns a variable value from the cache.

Parameters
string$entryIdentifier‪Identifier of the cache entry to fetch
Returns
‪string The value
Exceptions

Implements TYPO3\CMS\Core\Cache\Frontend\FrontendInterface.

Definition at line 77 of file StringFrontend.php.

References TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\isValidEntryIdentifier().

◆ getByTag()

array TYPO3\CMS\Core\Cache\Frontend\StringFrontend::getByTag (   $tag)

Finds and returns all cache entries which are tagged by the specified tag.

Parameters
string$tag‪The tag to search for
Returns
‪array An array with the content of all matching entries. An empty array if no entries matched
Exceptions

Definition at line 93 of file StringFrontend.php.

References TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\$identifier, and TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\isValidTag().

◆ set()

TYPO3\CMS\Core\Cache\Frontend\StringFrontend::set (   $entryIdentifier,
  $string,
array  $tags = [],
  $lifetime = null 
)

Saves the value of a PHP variable in the cache.

Parameters
string$entryIdentifier‪An identifier used for this cache entry
string$string‪The variable to cache
array$tags‪Tags to associate with this cache entry
int$lifetime‪Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.
Exceptions

Implements TYPO3\CMS\Core\Cache\Frontend\FrontendInterface.

Definition at line 54 of file StringFrontend.php.

References TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\isValidEntryIdentifier(), and TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend\isValidTag().