Zend Framework  3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AdapterOptions Class Reference

Unless otherwise marked, all options in this class affect all adapters. More...

Public Member Functions

 setAdapter (StorageInterface $adapter=null)
 Adapter using this instance.
 
 setKeyPattern ($keyPattern)
 Set key pattern.
 
 getKeyPattern ()
 Get key pattern.
 
 setNamespace ($namespace)
 Set namespace.
 
 getNamespace ()
 Get namespace.
 
 setReadable ($readable)
 Enable/Disable reading data from cache.
 
 getReadable ()
 If reading data from cache enabled.
 
 setTtl ($ttl)
 Set time to live.
 
 getTtl ()
 Get time to live.
 
 setWritable ($writable)
 Enable/Disable writing data to cache.
 
 getWritable ()
 If writing data to cache enabled.
 
 toArray ()
 Cast to array.
 
 setFromArray ($options)
 {}
 
- Public Member Functions inherited from AbstractOptions
 __construct ($options=null)
 Constructor.
 
 setFromArray ($options)
 Set one or more configuration properties.
 
 toArray ()
 Cast to array.
 
 __set ($key, $value)
 Set a configuration property.
 
 __get ($key)
 Get a configuration property.
 
 __isset ($key)
 Test if a configuration property is null.
 
 __unset ($key)
 Set a configuration property to NULL.
 

Protected Member Functions

 triggerOptionEvent ($optionName, $optionValue)
 Triggers an option event if this options instance has a connection to an adapter implements EventsCapableInterface.
 
 normalizeTtl (&$ttl)
 Validates and normalize a TTL.
 

Protected Attributes

 $__prioritizedProperties__ = []
 
 $adapter
 
 $keyPattern = ''
 
 $namespace = 'zfcache'
 
 $readable = true
 
 $ttl = 0
 
 $writable = true
 
- Protected Attributes inherited from AbstractOptions
 $__strictMode__ = true
 

Detailed Description

Unless otherwise marked, all options in this class affect all adapters.

Member Function Documentation

getKeyPattern ( )

Get key pattern.

Returns
string
getNamespace ( )

Get namespace.

Returns
string
getReadable ( )

If reading data from cache enabled.

Returns
bool
getTtl ( )

Get time to live.

Returns
float
getWritable ( )

If writing data to cache enabled.

Returns
bool
normalizeTtl ( $ttl)
protected

Validates and normalize a TTL.

Parameters
int | float$ttl
Exceptions
Exception\InvalidArgumentException
Returns
void
setAdapter ( StorageInterface  $adapter = null)

Adapter using this instance.

Parameters
StorageInterface | null$adapter
Returns
AdapterOptions
setFromArray (   $options)

{}

NOTE: This method was overwritten just to support prioritized properties https://github.com/zendframework/zf2/issues/6381

Parameters
array | Traversable | AbstractOptions$options
Exceptions
Exception\InvalidArgumentException
Returns
AbstractOptions Provides fluent interface
setKeyPattern (   $keyPattern)

Set key pattern.

Parameters
string$keyPattern
Exceptions
Exception\InvalidArgumentException
Returns
AdapterOptions
setNamespace (   $namespace)

Set namespace.

Parameters
string$namespace
Returns
AdapterOptions
setReadable (   $readable)

Enable/Disable reading data from cache.

Parameters
bool$readable
Returns
AbstractAdapter
setTtl (   $ttl)

Set time to live.

Parameters
int | float$ttl
Returns
AdapterOptions
setWritable (   $writable)

Enable/Disable writing data to cache.

Parameters
bool$writable
Returns
AdapterOptions
toArray ( )

Cast to array.

Returns
array
triggerOptionEvent (   $optionName,
  $optionValue 
)
protected

Triggers an option event if this options instance has a connection to an adapter implements EventsCapableInterface.

Parameters
string$optionName
mixed$optionValue
Returns
void

Member Data Documentation

$__prioritizedProperties__ = []
protected
$adapter
protected
$keyPattern = ''
protected
$namespace = 'zfcache'
protected
$readable = true
protected
$ttl = 0
protected
$writable = true
protected