Class for general track utility functions

package Gems
subpackage Util
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.0
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 an array of key/value pairs for gsu_id_survey and gsu_survey_name that are active

getActiveSurveys() : array

Returns

array

Retrieve an array of key/value pairs for gsu_id_survey and gsu_survey_name that are active

getActiveTracks(mixed $orgs = '1=1') : array

Parameters

$orgs

mixed

Either an array of org ids or an organization id or an sql select where statement

Returns

array

Returns array (id => name) of all ronds in all tracks, sorted by order

getAllRounds() : array

Returns

array

Retrieve an array of key/value pairs for gsu_id_survey and gsu_survey_name

getAllSurveys(boolean $active = false) : array

Parameters

$active

boolean

Only show active surveys Default: False

Returns

arrayof survey Id and survey name pairs

Retrieve an array of key/value pairs for gsu_id_survey and gsu_survey_name plus gsu_survey_description

getAllSurveysAndDescriptions() : array

Returns

array

Returns array (id => name) of all tracks, sorted alphabetically

getAllTracks() : array

Returns

array

Get an array of translated labels for the date units used by this engine

getDateUnitsList() : array
deprecated since 1.7.1 use Translated->getDatePeriodUnits()

Returns

arraydate_unit => label

Retrieve an array of key/value pairs for gsu_id_survey and gsu_survey_name that are active and are insertable

getInsertableSurveys() : array

Returns

array

getRespondentTokenFilter()

getRespondentTokenFilter(\type $respId, \type $orgId = null

Parameters

$respId

\type

$orgId

\type

Returns array (id => name) of all ronds in a track, sorted by order

getRoundsFor(integer $trackId) : array

Parameters

$trackId

integer

Returns

array

Returns array (id => name) of all 'T' tracks, sorted alphabetically

getSteppedTracks() : array
deprecated Since 1.7.1 getAllTracks() is all we need

Returns

array

Get the Rounds that use this survey

getSurveyRounds(integer $surveyId) : array

Parameters

$surveyId

integer

Returns

array

Get all the surveys for a certain code

getSurveysByCode(string $code) : array

Parameters

$code

string

Returns

arraysurvey id => survey name

Get all the surveys for a certain organization id

getSurveysFor(integer $organizationId) : array

Parameters

$organizationId

integer

Returns

arraysurvey id => survey name

Get surveys that do not have export codes

getSurveysWithoutExportCode() : array

Returns

array

Returns array (id => name) of the track date fields for this track, sorted by order

getTrackDateFields(integer $trackId) : array

Parameters

$trackId

integer

Returns

array

Returns title of the track.

getTrackTitle(integer $trackId) : string

Parameters

$trackId

integer

Returns

string

Get all the tracks for a certain survey

getTracksBySurvey(integer $surveyId) : array

Parameters

$surveyId

integer

Returns

arraysurvey id => survey name

Returns array (id => name) of all track date fields, sorted alphabetically

getTracksDateFields() : 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

 

Determine what to show when displaying tokens for a respondent.

$accessMode : integer

Default

self::SEE_CURRENT_ONLY

The default is only those of the current organization.

 

$cache

$cache : \Zend_Cache_Core

Default

 

$db

$db : \Zend_Db_Adapter_Abstract

Default

 

$loader

$loader : \Gems_Loader

Default

 

$source

$source : \MUtil_Registry_Source

Default

 

$translate

$translate : \Zend_Translate

Default

 Constants

 

When displaying tokens for a respondent all tokens from organizations accessible by the user should be shown.

SEE_ALL_ACCESSIBLE = 3 
 

When displaying tokens for a respondent only those of the current organization should be shown.

SEE_CURRENT_ONLY = 1 
 

When displaying tokens for a respondent all tokens from all organizations should be shown.

SEE_EVERYTHING = 2