Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Utils
  • none
  • Tracy
    • Bridges
      • Nette

Classes

  • Cache
  • OutputHelper

Interfaces

  • IStorage
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Cache

Implements the cache for a application.

Nette\Object
Extended by Nette\Caching\Cache implements ArrayAccess
Namespace: Nette\Caching
Located at Caching/Cache.php
Methods summary
public
# __construct( Nette\Caching\IStorage $storage, $namespace = NULL )
public Nette\Caching\IStorage
# getStorage( )

Returns cache storage.

Returns cache storage.

Returns

Nette\Caching\IStorage
IStorage
public string
# getNamespace( )

Returns cache namespace.

Returns cache namespace.

Returns

string
string
public Nette\Caching\Cache
# derive( string $namespace )

Returns new nested cache object.

Returns new nested cache object.

Parameters

$namespace

Returns

Nette\Caching\Cache
self
public mixed|null
# load( mixed $key, callable $fallback = NULL )

Reads the specified item from the cache or generate it.

Reads the specified item from the cache or generate it.

Parameters

$key
key
$fallback

Returns

mixed|null
mixed|NULL
public mixed
# save( mixed $key, mixed $data, array $dependencies = NULL )

Writes item into the cache. Dependencies are:

  • Cache::PRIORITY => (int) priority
  • Cache::EXPIRATION => (timestamp) expiration
  • Cache::SLIDING => (bool) use sliding expiration?
  • Cache::TAGS => (array) tags
  • Cache::FILES => (array|string) file names
  • Cache::ITEMS => (array|string) cache items
  • Cache::CONSTS => (array|string) cache items

Writes item into the cache. Dependencies are:

  • Cache::PRIORITY => (int) priority
  • Cache::EXPIRATION => (timestamp) expiration
  • Cache::SLIDING => (bool) use sliding expiration?
  • Cache::TAGS => (array) tags
  • Cache::FILES => (array|string) file names
  • Cache::ITEMS => (array|string) cache items
  • Cache::CONSTS => (array|string) cache items

Parameters

$key
key
$data
value
$dependencies
dependencies

Returns

mixed
value itself

Throws

Nette\InvalidArgumentException
Nette\InvalidArgumentException
public
# remove( mixed $key )

Removes item from the cache.

Removes item from the cache.

Parameters

$key
key
public
# clean( array $conditions = NULL )

Removes items from the cache by conditions. Conditions are:

  • Cache::PRIORITY => (int) priority
  • Cache::TAGS => (array) tags
  • Cache::ALL => TRUE

Removes items from the cache by conditions. Conditions are:

  • Cache::PRIORITY => (int) priority
  • Cache::TAGS => (array) tags
  • Cache::ALL => TRUE
public mixed
# call( mixed $function )

Caches results of function/method calls.

Caches results of function/method calls.

Parameters

$function

Returns

mixed
mixed
public Closure
# wrap( mixed $function, array $dependencies = NULL )

Caches results of function/method calls.

Caches results of function/method calls.

Parameters

$function
$dependencies
dependencies

Returns

Closure
\Closure
public Nette\Caching\OutputHelper|null
# start( mixed $key )

Starts the output cache.

Starts the output cache.

Parameters

$key
key

Returns

Nette\Caching\OutputHelper|null
OutputHelper|NULL
protected string
# generateKey( string $key )

Generates internal cache key.

Generates internal cache key.

Parameters

$key

Returns

string
string
public
# offsetSet( $key, $data )

Deprecated

Implementation of

ArrayAccess::offsetSet()
public
# offsetGet( $key )

Deprecated

Implementation of

ArrayAccess::offsetGet()
public
# offsetExists( $key )

Deprecated

Implementation of

ArrayAccess::offsetExists()
public
# offsetUnset( $key )

Deprecated

Implementation of

ArrayAccess::offsetUnset()
public
# release( )

Deprecated

public static boolean
# checkCallbacks( array $callbacks )

Checks CALLBACKS dependencies.

Checks CALLBACKS dependencies.

Parameters

$callbacks

Returns

boolean
bool
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants summary
string PRIORITY

dependency

dependency

#'priority'
string EXPIRATION

dependency

dependency

#'expire'
string EXPIRE

dependency

dependency

#'expire'
string SLIDING

dependency

dependency

#'sliding'
string TAGS

dependency

dependency

#'tags'
string FILES

dependency

dependency

#'files'
string ITEMS

dependency

dependency

#'items'
string CONSTS

dependency

dependency

#'consts'
string CALLBACKS

dependency

dependency

#'callbacks'
string ALL

dependency

dependency

#'all'
Magic properties inherited from Nette\Object
$reflection
Nette 2.3-20161221 API API documentation generated by ApiGen 2.8.0