Lookup global information from the database, allowing for project specific overrides

package Gems
subpackage Util
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
inherited_from \Gems\Util\UtilAbstract

 Methods

Returns a callable if a method is called as a variable

__get(string $name) : \MUtil_Lazy_Call
Inherited

Parameters

$name

string

Returns

\MUtil_Lazy_Call

Cleans up everything to a save cacheId

cleanupForCacheId(string $cacheId) : string
InheritedStatic

Parameters

$cacheId

string

Returns

string

Retrieve a list of orgid/name pairs

getActiveOrganizations() : array

Returns

array

Return key/value pairs of all active staff members

getActiveStaff() : array

Returns

array

Return key/value pairs of all active staff groups

getActiveStaffGroups() : array

Returns

array

Return key/value pairs of all active staff groups

getActiveStaffRoles() : array

Returns

array

Retrieve an array of groups the user is allowed to assign: his own group and all groups he inherits rights from

getAllowedRespondentGroups() : array

Returns

array

Retrieve an array of groups the user is allowed to assign: his own group and all groups he inherits rights from

getAllowedStaffGroups() : array
deprecated Since 1.7.2 Replaced by loader->getCurrentUser()->getAllowedStaffGroups()

Returns

array

Return the available Comm templates.

getCommTemplates($mailTarget = false) : array
staticvar array $data

Parameters

$mailTarget

Returns

arrayThe tempalteId => subject list

getDefaultGroup()

getDefaultGroup() 

Get the filter to use on the tokenmodel when working with a mailjob.

getFilterForMailJob(array $job) : array

Parameters

$job

array

Returns

array

The active groups

getGroups() : array

Returns

array

Get all active organizations

getOrganizations() : array

Returns

arrayList of the active organizations

Get all organizations that share a given code

getOrganizationsByCode(string $code = null) : array

On empty this will return all organizations

Parameters

$code

string

Returns

arraykey = gor_id_organization, value = gor_name

Returns a list of the organizations where users can login.

getOrganizationsForLogin() : array

Returns

arrayList of the active organizations

Returns a list of the organizations that have respondents.

getOrganizationsWithRespondents() : array

Returns

arrayList of the active organizations

Find the patient nr corresponding to this respondentId / Orgid combo

getPatientNr(integer $respondentId, integer $organizationId) : string

Parameters

$respondentId

integer

$organizationId

integer

Exceptions

\Gems_Exception When the patient does not exist

Returns

stringA patient nr or null

Find the respondent id corresponding to this patientNr / Orgid combo

getRespondentId(string $patientId, integer $organizationId) : integer

Parameters

$patientId

string

$organizationId

integer

Exceptions

\Gems_Exception When the respondent does not exist

Returns

integerA respondent id or null

Find the respondent id name corresponding to this patientNr / Orgid combo

getRespondentIdAndName(string $patientId, integer $organizationId) : array

Parameters

$patientId

string

$organizationId

integer

Exceptions

\Gems_Exception When the respondent does not exist

Returns

array['id', 'name']

Returns the roles in the acl

getRoles() : array

Returns

arrayroleId => ucfirst(roleId)

Returns the roles in the acl with the privilege

getRolesByPrivilege($privilege) : array

Parameters

$privilege

Returns

arrayroleId => ucfirst(roleId)

Get all round descriptions for exported

getRoundsForExport(integer $trackId = null, integer $surveyId = null) : array

Parameters

$trackId

integer

Optional track id

$surveyId

integer

Optional survey id

Returns

array

Return key/value pairs of all staff members, currently active or not

getStaff() : array

Returns

array

Return key/value pairs of all staff groups, including not active

getStaffGroups() : array

Returns

array

Get all surveys that can be exported

getSurveysForExport(integer $trackId = null, $roundDescription = null, $flat = false) : array

For export not only active surveys should be returned, but all surveys that can be exported. As this depends on the kind of source used it is in this method so projects can change to adapt to their own sources.

Parameters

$trackId

integer

Optional track id

$roundDescription

$flat

Returns

array

getUserConsents()

getUserConsents() : array

Returns

array

Utility function for loading a complete query from cache into objects

_getObjectsAllCached(string $cacheId, object $object, mixed $sql, array $binds = null, mixed $tags = array()) : array
Inherited

Parameters

$cacheId

string

The class is prepended to this id

$object

object

The object to put the data in

$sql

mixed

string or \Zend_Db_Select

$binds

array

sql paramters

$tags

mixed

atring or array of strings

Returns

array

Utility function for loading a complete query from cache

_getSelectAllCached(string $cacheId, mixed $sql, array $binds = array(), mixed $tags = array()) : array
Inherited

Parameters

$cacheId

string

The class is prepended to this id

$sql

mixed

string or \Zend_Db_Select

$binds

array

sql paramters

$tags

mixed

atring or array of strings

Returns

array

Utility function for loading a query paired from cache

_getSelectPairsCached(string $cacheId, mixed $sql, array $binds = array(), mixed $tags = array(), string $sort = null) : array
Inherited

Parameters

$cacheId

string

The class is prepended to this id

$sql

mixed

string or \Zend_Db_Select

$binds

array

sql paramters

$tags

mixed

atring or array of strings

$sort

string

Optional function to sort on, only known functions will do

Returns

array

Utility function for loading a query from cache

_getSelectPairsProcessedCached(string $cacheId, mixed $sql, callable $function, array $binds = array(), mixed $tags = array(), string $sort = null) : array
Inherited

Parameters

$cacheId

string

The class is prepended to this id

$sql

mixed

string or \Zend_Db_Select

$function

callable

The function called with each row to form the result

$binds

array

sql paramters

$tags

mixed

string or array of strings

$sort

string

Optional function to sort on, only known functions will do

Returns

array

Utility function for loading a query from cache

_getSelectProcessedCached(string $cacheId, mixed $sql, callable $function, string $keyField, mixed $tags = array(), string $sort = null) : array
Inherited

Parameters

$cacheId

string

The class is prepended to this id

$sql

mixed

string or \Zend_Db_Select

$function

callable

The function called with each row to form the result

$keyField

string

The field containing the key for each row

$tags

mixed

string or array of strings

$sort

string

Optional function to sort on, only known functions will do

Returns

array

Sort the array using the specified sort function

_sortResult(array $result, \Gems\Util\strng $sort = 'asort'
Inherited

Parameters

$result

array

$sort

\Gems\Util\strng

 Properties

 

$acl

$acl : \Zend_Acl

Default

 

$cache

$cache : \Zend_Cache_Core

Default

 

$db

$db : \Zend_Db_Adapter_Abstract

Default

 

$loader

$loader : \Gems_Loader

Default

 

$source

$source : \MUtil_Registry_Source

Default

 

$util

$util : \Gems_Util

Default