Modules/Default/Registry/Facade.php
\Conjoon_Modules_Default_Registry_Facade
Package: DefaultThis facade eases the access to often needed operations on the registry.
- Author
-
Thorsten Suckow-Homberg
Properties
Methods



_mapApplicationConfiguration(
$entries
)
:
voidMaps application specific registry values to the registry. Those
values are generally marked as not editable since they depend on
system configurations.
The values that get applied are:
client/environment/device - either iphone or default (HTTP_USER_AGENT)
base/conjoon/name - hardcoded to "conjoon" as of now
base/conjoon/version - read from Conjoon_Version (Conjoon_Version::VERSION)
base/conjoon/edition - read from application config
server/php/max_execution_time - read from php ini
server/environment host, port, protocol - server environment settings
Parameters
| Name |
Type |
Description |
| $entries |
|
array |



_pathToIndex(
string $path, array $entries
)
:
arrayFinds the indexes of the path in entries and returns the array with
the found index, whereas the first index maps the first part of the
path and so on. Returns an empty array if the path could not be found.
Parameters
| Name |
Type |
Description |
| $path |
string |
|
| $entries |
array |
|
Returns



_toDtos(
array $entries
)
:
arrayTransforms the specified array to a list of
Conjoon_Modules_Default_Registry_Dto
Parameters
| Name |
Type |
Description |
| $entries |
array |
|
Returns



getRegistryForUserId(
integer $userId, $toDto
=
true
)
:
array | \Conjoon_Modules_Groupware_Email_Folder_DtoReturns the registry as an array of Conjoon_Modules_Default_Registry_Dto.
Parameters
| Name |
Type |
Description |
| $userId |
integer |
|
| $toDto |
|
|
Returns
Throws



getValueForKeyAndUserId(
string $key, integer $userId
)
:
mixedReturns the value for the specified key and the user.
Parameters
| Name |
Type |
Description |
| $key |
string |
|
| $userId |
integer |
|
Returns
Throws



setEntriesFromDataForUserId(
array $data, integer $userId
)
:
arraySets the specified keys in $data to theri mapped values.
Parameters
| Name |
Type |
Description |
| $data |
array |
A numeric array with associative entries, i.e. [[ 'key' => '/somekey/anotherkey', 'value' => 1]]
|
| $userId |
integer |
The id of the user for which the entries should be set. If those entries do not already exist for the specified userId, this entries will be created. |
Returns
| Type |
Description |
| array |
Returns an associative array with the following keys: - updated: A list of keys that were actually updated - failed: list with keys that could not be updated |
Throws
| Exception |
Description |
| \InvalidArgumentException |
throws an InvalidArgumentException if the specified $userId was noit valid or Conjoon_Filter_Exception if the submitted data could not be sanitized |