Modules/Groupware/Feeds/Account/ListBuilder.php
\Conjoon_Modules_Groupware_Feeds_Account_ListBuilder
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

string
$_buildClass= ''Conjoon_Modules_Groupware_Feeds_Account_Dto''
'Conjoon_Modules_Groupware_Feeds_Account_Dto'Details- Type
- string

\Zend_Cache_Core
$_cache= 'null'
nullDetails- Type
- \Zend_Cache_Core
- Inherited_from
- \Conjoon_Builder::$$_cache

\Conjoon_BeanContext_Decoratable
$_model= 'null'
nullDetails- Type
- \Conjoon_BeanContext_Decoratable
- Inherited_from
- \Conjoon_Builder::$$_model

bool
$_noBuildClassNeeded= 'false'
falseDetails- Type
- bool
- Inherited_from
- \Conjoon_Builder::$$_noBuildClassNeeded
Methods

__construct(
\Zend_Cache_Core $cache
=
null, $model
=
null
)
:
void
| 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 |

_build(
array $options, \Conjoon_BeanContext_Decoratable $model
)
:
ArrayReturns either a cached list of feed accounts for a user, or the accounts out of the database.
It's purpose is to build the objects that have to be cached.
| Name | Type | Description |
|---|---|---|
| $options | array | An associative array with the following key value/pairs: - userId: the id of the user to fetch all feed accounts for |
| $model | \Conjoon_BeanContext_Decoratable |
| Type | Description |
|---|---|
| Array | an array with instances of Conjoon_Modules_Groupware_Feeds_Account_Model_Account_Dto |

_buildId(
array $options
)
:
StringAn abstract function which returns an id that can be used to identify cache objects.
| Name | Type | Description |
|---|---|---|
| $options | array | An associative array with the following key value/pairs: - userId: the id of the user to fetch al twitter accounts for |
| Type | Description |
|---|---|
| String |

_checkValidGetOptions(
$options
)
:
voidValidates 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.
| Name | Type | Description |
|---|---|---|
| $options |

_checkValidTagOptions(
$options
)
:
voidValidates 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.
| Name | Type | Description |
|---|---|---|
| $options |

_getModel(
)
:
\Conjoon_Modules_Groupware_Feeds_Account_Model_Account| Type | Description |
|---|---|
| \Conjoon_Modules_Groupware_Feeds_Account_Model_Account |

_getTagList(
array $options
)
:
ArrayAn abstract function which returns a numerical array with tag ids as their values.
IF this method does not return an empty array, those ids will be used to tag a cached item.
| Name | Type | Description |
|---|---|---|
| $options | array | An associative array with the following key value/pairs: - accountId: The id of the related account this feed was retrieved for |
| Type | Description |
|---|---|
| Array |

buildId(
array $options
)
:
StringA 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.
| 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. |
| Type | Description |
|---|---|
| String |

clean(
string $type, array $options
=
array()
)
:
void
| 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 |
- See
- \Zend_Cache::clean

cleanCacheForTags(
$options
)
:
voidCleans the cache with all cached items that where tagged with the tags found in the return value of getTagList.
Inherited from: \Conjoon_Builder::cleanCacheForTags()| Name | Type | Description |
|---|---|---|
| $options |
- See
- \clean
- See
- \getTagList

get(
array $options
)
:
mixedChecks 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()| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| mixed |
| Exception | Description |
|---|---|
| \Conjoon_Builder_Exception | if the keys specified in $_validGetOptions are not specified in $options |
- See
- \_get

getModel(
)
:
\Conjoon_BeanContext_Decoratable| Type | Description |
|---|---|
| \Conjoon_BeanContext_Decoratable |

getTagList(
array $options
)
:
ArrayA function which returns an array with tag ids that can be used to tag a cached item.
Inherited from: \Conjoon_Builder::getTagList()| 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. |
| Type | Description |
|---|---|
| Array |