Cache\AbstractCache 
-
Namespace
Phalcon\Cache
-
Uses
DateIntervalPhalcon\Cache\Adapter\AdapterInterfacePhalcon\Cache\Exception\InvalidArgumentExceptionTraversable
-
Extends
-
Implements
CacheInterface
This component offers caching capabilities for your application.
Properties
/**
* The adapter
*
* @var AdapterInterface
*/
protected $adapter;Methods
public function __construct( AdapterInterface $adapter );Constructor.
public function getAdapter(): AdapterInterface;Returns the current adapter
protected function checkKey( string $key ): void;Checks the key. If it contains invalid characters an exception is thrown
protected function checkKeys( mixed $keys ): void;Checks the key. If it contains invalid characters an exception is thrown
protected function doClear(): bool;Wipes clean the entire cache’s keys.
protected function doDelete( string $key ): bool;Delete an item from the cache by its unique key.
protected function doDeleteMultiple( mixed $keys ): bool;Deletes multiple cache items in a single operation.
protected function doGet( string $key, mixed $defaultValue = null );Fetches a value from the cache.
protected function doGetMultiple( mixed $keys, mixed $defaultValue = null );Obtains multiple cache items by their unique keys.
protected function doHas( string $key ): bool;Determines whether an item is present in the cache.
protected function doSet( string $key, mixed $value, mixed $ttl = null ): bool;Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
protected function doSetMultiple( mixed $values, mixed $ttl = null ): bool;Persists a set of key => value pairs in the cache, with an optional TTL.
abstract protected function getExceptionClass(): string;Returns the exception class that will be used for exceptions thrown
Cache\Adapter\AdapterInterface 
-
Namespace
Phalcon\Cache\Adapter
-
Uses
Phalcon\Storage\Adapter\AdapterInterface
-
Extends
StorageAdapterInterface -
Implements
Interface for Phalcon\Cache adapters
Cache\Adapter\Apcu
-
Namespace
Phalcon\Cache\Adapter
-
Uses
Phalcon\Cache\Adapter\AdapterInterfacePhalcon\Storage\Adapter\Apcu
-
Extends
StorageApcu -
Implements
CacheAdapterInterface
Apcu adapter
Cache\Adapter\Libmemcached
-
Namespace
Phalcon\Cache\Adapter
-
Uses
Phalcon\Cache\Adapter\AdapterInterfacePhalcon\Storage\Adapter\Libmemcached
-
Extends
StorageLibmemcached -
Implements
CacheAdapterInterface
Libmemcached adapter
Cache\Adapter\Memory
-
Namespace
Phalcon\Cache\Adapter
-
Uses
Phalcon\Cache\Adapter\AdapterInterfacePhalcon\Storage\Adapter\Memory
-
Extends
StorageMemory -
Implements
CacheAdapterInterface
Memory adapter
Cache\Adapter\Redis
-
Namespace
Phalcon\Cache\Adapter
-
Uses
Phalcon\Cache\Adapter\AdapterInterfacePhalcon\Storage\Adapter\Redis
-
Extends
StorageRedis -
Implements
CacheAdapterInterface
Redis adapter
Cache\Adapter\Stream
-
Namespace
Phalcon\Cache\Adapter
-
Uses
Phalcon\Cache\Adapter\AdapterInterfacePhalcon\Storage\Adapter\Stream
-
Extends
StorageStream -
Implements
CacheAdapterInterface
Stream adapter
Cache\Adapter\Weak
-
Namespace
Phalcon\Cache\Adapter
-
Uses
Phalcon\Cache\Adapter\AdapterInterfacePhalcon\Storage\Adapter\Weak
-
Extends
StorageWeak -
Implements
CacheAdapterInterface
- WeakCache implementation based on WeakReference */
Cache\AdapterFactory
-
Namespace
Phalcon\Cache
-
Uses
Phalcon\Cache\Adapter\AdapterInterfacePhalcon\Cache\Exception\ExceptionPhalcon\Factory\AbstractFactoryPhalcon\Storage\SerializerFactory
-
Extends
AbstractFactory -
Implements
Factory to create Cache adapters
Properties
/**
* @var SerializerFactory
*/
private $serializerFactory;Methods
public function __construct( SerializerFactory $factory, array $services = [] );AdapterFactory constructor.
public function newInstance( string $name, array $options = [] ): AdapterInterface;Create a new instance of the adapter
protected function getExceptionClass(): string;protected function getServices(): array;Returns the available adapters
Cache\Cache
-
Namespace
Phalcon\Cache
-
Uses
DateIntervalPhalcon\Cache\Adapter\AdapterInterfacePhalcon\Cache\Exception\InvalidArgumentException
-
Extends
AbstractCache -
Implements
This component offers caching capabilities for your application.
Methods
public function clear(): bool;Wipes clean the entire cache’s keys.
public function delete( string $key ): bool;Delete an item from the cache by its unique key.
public function deleteMultiple( mixed $keys ): bool;Deletes multiple cache items in a single operation.
public function get( string $key, mixed $defaultValue = null );Fetches a value from the cache.
public function getMultiple( mixed $keys, mixed $defaultValue = null );Obtains multiple cache items by their unique keys.
public function has( string $key ): bool;Determines whether an item is present in the cache.
public function set( string $key, mixed $value, mixed $ttl = null ): bool;Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
public function setMultiple( mixed $values, mixed $ttl = null ): bool;Persists a set of key => value pairs in the cache, with an optional TTL.
protected function getExceptionClass(): string;Returns the exception class that will be used for exceptions thrown
Cache\CacheFactory
-
Namespace
Phalcon\Cache
-
Uses
Phalcon\Cache\Adapter\AdapterInterfacePhalcon\Cache\CachePhalcon\Cache\Exception\ExceptionPhalcon\Config\ConfigInterfacePhalcon\Factory\AbstractConfigFactory
-
Extends
AbstractConfigFactory -
Implements
Creates a new Cache class
Properties
/**
* @var AdapterFactory
*/
protected $adapterFactory;Methods
public function __construct( AdapterFactory $factory );Constructor
public function load( mixed $config ): CacheInterface;Factory to create an instance from a Config object
public function newInstance( string $name, array $options = [] ): CacheInterface;Constructs a new Cache instance.
protected function getExceptionClass(): string;Cache\CacheInterface 
-
Namespace
Phalcon\Cache
-
Uses
DateIntervalPhalcon\Cache\Exception\InvalidArgumentException
-
Extends
-
Implements
Interface for Phalcon\Cache\Cache
Methods
public function clear(): bool;Wipes clean the entire cache’s keys.
public function delete( string $key ): bool;Delete an item from the cache by its unique key.
public function deleteMultiple( mixed $keys ): bool;Deletes multiple cache items in a single operation.
public function get( string $key, mixed $defaultValue = null );Fetches a value from the cache.
public function getMultiple( mixed $keys, mixed $defaultValue = null );Obtains multiple cache items by their unique keys.
public function has( string $key ): bool;Determines whether an item is present in the cache.
public function set( string $key, mixed $value, mixed $ttl = null ): bool;Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time.
public function setMultiple( mixed $values, mixed $ttl = null ): bool;Persists a set of key => value pairs in the cache, with an optional TTL.
Cache\Exception\Exception
-
Namespace
Phalcon\Cache\Exception
-
Uses
-
Extends
\Exception -
Implements
Exceptions thrown in Phalcon\Cache will use this class
Cache\Exception\InvalidArgumentException
-
Namespace
Phalcon\Cache\Exception
-
Uses
-
Extends
\Exception -
Implements
Exceptions thrown in Phalcon\Cache will use this class