Modules/Groupware/Email/Folder/FolderRootTypeBuilder.php

Show: inherited
Table of Contents

\Conjoon_Modules_Groupware_Email_Folder_FolderRootTypeBuilder

Package:

This class can be used to implement a concrete strategy for returning objects out of the cache or directly from the data storage.

Providing a cache object when instantiating an object of this class, the get() method should return the object either directly out of the cache or from the data storage. Later look ups should use the cache, wheras the logic to determine whether the cache is still valid is done by the cache object itself.

Example for a concrete implementation of get():


 class User_Builder extends Conjoon_Builder {

 public function get($id)
 {
     $user = null;

     if (!$this->_cache->test($id)) {

         $user = new User;
         // expensive operations here

         $this->_cache->save($user, $id);
     } else {
         $user = $this->_cache->load($id);
     }

     return $user;

 }

}

Parent(s)
\Conjoon_Builder
Author
Thorsten-Suckow-Homberg  

Properties

Propertyprotectedstring  $_buildClass= 'null'
inherited

mandatory, the class the builder has to use for creating cached objectsInherited from: \Conjoon_Builder::$$_buildClass
Default valuenullDetails
Type
string
Inherited_from
\Conjoon_Builder::$$_buildClass  
Propertyprotected\Zend_Cache_Core  $_cache= 'null'
inherited

Inherited from: \Conjoon_Builder::$$_cache
Default valuenullDetails
Type
\Zend_Cache_Core
Inherited_from
\Conjoon_Builder::$$_cache  
Propertyprotected\Conjoon_BeanContext_Decoratable  $_model= 'null'
inherited

Inherited from: \Conjoon_Builder::$$_model
Default valuenullDetails
Type
\Conjoon_BeanContext_Decoratable
Inherited_from
\Conjoon_Builder::$$_model  
Propertyprotectedbool  $_noBuildClassNeeded= 'true'

Explicitely set this to true if you do not need a build class required before cache gets resolved
Default valuetrueDetails
Type
bool
Propertyprotectedarray  $_validGetOptions= 'array('folderId')'

Default valuearray('folderId')Details
Type
array
Propertyprotectedarray  $_validTagOptions= 'array()'
inherited

Inherited from: \Conjoon_Builder::$$_validTagOptions
Default valuearray()Details
Type
array
Inherited_from
\Conjoon_Builder::$$_validTagOptions  

Methods

methodpublic__construct( \Zend_Cache_Core $cache = null,  $model = null ) : void
inherited

Constructor.

Inherited from: \Conjoon_Builder::__construct()
Parameters
Name Type Description
$cache \Zend_Cache_Core

The cache to use for retrieving or storing an object. If not supplied, this builder won't have any caching functionality.

$model

Conjoon_BeanContext_Decoratable

methodprotected_build( array $options, \Conjoon_BeanContext_Decoratable $model ) : String

An abstract function which concrete implementation has to be provided in the classes deriving from Conjoon_Builder.

It's purpose is to build the objects that have to be cached.

Parameters
Name Type Description
$options array

An associative array with the following key value/pairs: - folderId: The id of the folder

$model \Conjoon_BeanContext_Decoratable
Returns
Type Description
String
methodprotected_buildId( array $options ) : String

An abstract function which returns an id that can be used to identify cache objects.

Parameters
Name Type Description
$options array

An associative array with the following key value/pairs: - folderId: The id of the folder

Returns
Type Description
String
methodprotected_checkValidGetOptions(  $options ) : void
inherited

Validates the keys of the passed array against the whitelist of keys specified in $_validGetOptions.

Inherited from: \Conjoon_Builder::_checkValidGetOptions()

Throws an exception if there is a key missing in the passed argument that was specified in $_validGetOptions.

Parameters
Name Type Description
$options
methodprotected_checkValidTagOptions(  $options ) : void
inherited

Validates the keys of the passed array against the whitelist of keys specified in $_validTagOptions.

Inherited from: \Conjoon_Builder::_checkValidTagOptions()

Throws an exception if there is a key missing in the passed argument that was specified in $_validTagOptions.

Parameters
Name Type Description
$options
methodprotected_getModel( ) : null

Returns
Type Description
null
methodprotected_getTagList( Array $options ) : Array
inherited

An abstract function which returns a numerical array with tag ids as their values.

Inherited from: \Conjoon_Builder::_getTagList()

IF this method does not return an empty array, those ids will be used to tag a cached item.

Parameters
Name Type Description
$options Array

a hash with key/value pairs which can be used to build a tag list

Returns
Type Description
Array
methodpublicbuildId( array $options ) : String
inherited

A function which returns an id under which an object in the cache can be identified.

Inherited from: \Conjoon_Builder::buildId()

The returned key will be used to identify objects in the clean() and get() method of this class.

Parameters
Name Type Description
$options array

An associative array of options to use. If the _validGetOptions property is specified, the options will be checked against this property.

Returns
Type Description
String
methodpublicclean( string $type, array $options = array() ) : void
inherited

Cleans the cache based on the passed parameters.

Inherited from: \Conjoon_Builder::clean()
Parameters
Name Type Description
$type string

Any of Zend_Cache::CLEANING_MODE_ALL Zend_Cache::CLEANING_MODE_OLD Zend_Cache::CLEANING_MODE_MATCHING_TAG Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG

$options array

When using any tag related clean up, this array should hold all related tags for this operation

Details
See
\Zend_Cache::clean  
methodpubliccleanCacheForTags(  $options ) : void
inherited

Cleans the cache with all cached items that where tagged with the tags found in the return value of getTagList.

Inherited from: \Conjoon_Builder::cleanCacheForTags()
Parameters
Name Type Description
$options
Details
See
\clean  
See
\getTagList  
methodpublicget( array $options ) : mixed
inherited

Checks whether the keys specified in $_validGetOptions are available in $options. Throws an exception if that is not the case, otherwise calls the concrete implementation of _get.

Inherited from: \Conjoon_Builder::get()
Parameters
Name Type Description
$options array
Returns
Type Description
mixed
Throws
Exception Description
\Conjoon_Builder_Exception if the keys specified in $_validGetOptions are not specified in $options
Details
See
\_get  
methodpublicgetModel( ) : \Conjoon_BeanContext_Decoratable
inherited

Inherited from: \Conjoon_Builder::getModel()
Returns
Type Description
\Conjoon_BeanContext_Decoratable
methodprotectedgetTagList( array $options ) : Array
inherited

A function which returns an array with tag ids that can be used to tag a cached item.

Inherited from: \Conjoon_Builder::getTagList()
Parameters
Name Type Description
$options array

An associative array of options to use. If the _validTagOptions property is specified, the options will be checked against this property.

Returns
Type Description
Array
methodpublicremove( array $options ) : void
inherited

Removes an object from the cache, if available.

Inherited from: \Conjoon_Builder::remove()
Parameters
Name Type Description
$options array

An array of options which will be considered in buildId

Documentation was generated by DocBlox 0.18.1.