Modules/Default/Registry/Facade.php

Show: inherited
Table of Contents

\Conjoon_Modules_Default_Registry_Facade

Package: Default

This facade eases the access to often needed operations on the registry.

Author
Thorsten Suckow-Homberg  

Properties

Propertyprivate\Conjoon_Modules_Default_Registry_Facade  $_instance= 'null'
static

Default valuenullDetails
Type
\Conjoon_Modules_Default_Registry_Facade
Propertyprivate\Conjoon_Modules_Default_Registry_Model_Registry  $_registryModel= 'null'

Default valuenullDetails
Type
\Conjoon_Modules_Default_Registry_Model_Registry
Propertyprivate\Conjoon_Modules_Default_Registry_Model_RegistryValues  $_registryValuesModel= 'null'

Propertyprivate\Conjoon_Modules_Default_Registry_Filter_Registry  $_updateEntriesFilter= 'null'

Methods

methodprivate__clone( ) : void

Enforce singleton.

methodprivate__construct( ) : void

Enforce singleton.

methodprivate_getUpdateEntriesFilter( ) : void

methodprivate_mapApplicationConfiguration(  $entries ) : void

Maps 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

methodprivate_pathToIndex( string $path, array $entries ) : array

Finds 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
Type Description
array
methodprivate_toDtos( array $entries ) : array

Transforms the specified array to a list of Conjoon_Modules_Default_Registry_Dto

Parameters
Name Type Description
$entries array
Returns
Type Description
array
methodpublicgetRegistryForUserId( integer $userId,  $toDto = true ) : array | \Conjoon_Modules_Groupware_Email_Folder_Dto

Returns the registry as an array of Conjoon_Modules_Default_Registry_Dto.

Parameters
Name Type Description
$userId integer
$toDto
Returns
Type Description
array | \Conjoon_Modules_Groupware_Email_Folder_Dto an array of Conjoon_Modules_Groupware_Email_Folder_Dto
Throws
Exception Description
\InvalidArgumentException
methodpublicgetValueForKeyAndUserId( string $key, integer $userId ) : mixed

Returns the value for the specified key and the user.

Parameters
Name Type Description
$key string
$userId integer
Returns
Type Description
mixed
Throws
Exception Description
\InvalidArgumentException
methodpublicsetEntriesFromDataForUserId( array $data, integer $userId ) : array

Sets 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
Documentation was generated by DocBlox 0.18.1.