Object class for checking and changing tokens.
package | Gems |
---|---|
subpackage | Tracker |
copyright | Copyright (c) 2011 Erasmus MC |
license | New BSD License |
since | Class available since version 1.4 |
inherited_from | \Gems_Registry_TargetAbstract |
__construct(mixed $gemsTokenData)
mixed
Token Id or array containing token record
__get(string $name) : Callable
string
Callable
applyToMenuSource(\Gems_Menu_ParameterSource $source) : \Gems_Tracker_Token
\Gems_Menu_ParameterSource
\Gems_Tracker_Token
(continuation pattern)assignTo(integer $respondentRelationId, integer $relationFieldId) : integer
integer
integer
integer
1 if data changed, 0 otherwisecacheGet(string $key, mixed $defaultValue = null
) : mixed
For speeding up things the token can hold a local cache, living as long as the token object exists in memory. Sources can use this to store reusable information.
To reset the cache on an update, the source can use the cacheReset method or the setCache method to update the changed value.
string
The key used in the cache
mixed
The optional default value to use when it is not present
mixed
cacheHas(string $key) : boolean
string
boolean
cacheReset(string|null $key = null
)
You can pass in an optional $key parameter to reset just that key, otherwise all the cache will be reset
string
null
The key to reset
cacheSet(string $key, mixed $value)
string
mixed
checkRegistryRequestsAnswers() : boolean
boolean
False if required are missing.checkTokenCompletion(integer $userId) : integer
integer
The id of the gems user
integer
self::COMPLETION_NOCHANGE || (self::COMPLETION_DATACHANGE | self::COMPLETION_EVENTCHANGE)createReplacement(string $newComment, integer $userId) : string
Returns the new token id
string
Description of why the token was replaced
integer
The current user
string
The new tokengetAllUnansweredTokens($where = ''
) : array
Similar to @see $this->getNextUnansweredToken() Similar to @see $this->getTokenCountUnanswered()
array
of tokendatagetAnswerDateTime(string $fieldName) : \MUtil_Date
string
Name of answer field
\MUtil_Date
date time or nullgetAnswerSnippetNames() : string
string
getArrayCopy() : array
array
getChangedBy() : integer
integer
getComment() : string
string
getCompletionTime() : \MUtil_Date
\MUtil_Date
Completion time as a date or nullgetConsentCode() : string
string
getCreatedBy() : integer
integer
getDateTime(string $fieldName) : \MUtil_Date
string
\MUtil_Date
getDeleteSnippetNames() : array
array
of stringsgetEditSnippetNames() : array
array
of stringsgetEmail() : string | null
This method will return null when no address available
string
null
Email address of the person who needs to fill out the survey or nullgetMailSentDate() : string
string
Last mail sent dategetModel() : \Gems_Tracker_Model_StandardTokenModel
\Gems_Tracker_Model_StandardTokenModel
getNextToken() : \Gems_Tracker_Token
\Gems_Tracker_Token
getNextUnansweredToken() : \Gems_Tracker_Token
\Gems_Tracker_Token
getOrganization() : \Gems_User_Organization
\Gems_User_Organization
getOrganizationId() : integer
integer
getPatientNumber() : string
string
The respondents patient numbergetPreviousSuccessToken() : \Gems_Tracker_Token
\Gems_Tracker_Token
getPreviousToken() : \Gems_Tracker_Token
\Gems_Tracker_Token
getRawAnswers() : array
Function may return more fields than just the answers.
array
Field => Value arraygetReceptionCode() : \Gems_Util_ReceptionCode
\Gems_Util_ReceptionCode
reception codegetRelation() : \Gems_Model_RespondentRelationInstance
\Gems_Model_RespondentRelationInstance
getRelationFieldId() : integer
This is not the id of the relation, but the id of the trackfield that defines the relation.
integer
getRelationFieldName() : string
string
getRelationId() : integer
integer
getRespondent() : \Gems_Tracker_Respondent
\Gems_Tracker_Respondent
getRespondentGender() : string
string
getRespondentGenderHello() : string
string
getRespondentId() : integer
integer
getRespondentLanguage() : string
string
Two letter language codegetRespondentLastName() : string
string
getRespondentName() : string
Could be the patient or the relation when assigned to one
string
getRespondentTrack() : \Gems_Tracker_RespondentTrack
\Gems_Tracker_RespondentTrack
getRespondentTrackId() : integer
integer
getReturnUrl() : string
string
getRoundCode() : string | null
string
null
Null when no round id is present or round no longer existsgetRoundDescription() : string
string
Round descriptiongetRoundId() : integer
integer
round idgetRoundOrder() : integer
integer
round ordergetShowSnippetNames() : string
string
getStatus() : string
string
Token status descriptiongetSubjectname() : string
To be used when there is a relation and you need to know the name of the respondent
string
getSurvey() : \Gems_Tracker_Survey
\Gems_Tracker_Survey
getSurveyAnswerModel(string $language) : \MUtil_Model_ModelAbstract
string
(ISO) language string
\MUtil_Model_ModelAbstract
getSurveyId() : integer
integer
Gems survey idgetSurveyName() : string
string
Name of the surveygetTokenCountUnanswered() : integer
integer
getTokenId() : string
string
tokengetTrackEngine() : \Gems_Tracker_Engine_TrackEngineInterface
\Gems_Tracker_Engine_TrackEngineInterface
getTrackId() : integer
integer
gems_tracks track idgetTrackName()
getUrl(string $language, integer $userId)
string
The language currently used by the user
integer
The id of the gems user
\Gems_Tracker_Source_SurveyNotFoundException |
---|
getValidFrom() : \MUtil_Date
\MUtil_Date
Valid from as a date or nullgetValidUntil() : \MUtil_Date
\MUtil_Date
Valid until as a date or nullhandleAfterCompletion() : array
array
The changed valueshandleBeforeAnswering() : array
array
The changed valueshasAnswersLoaded() : boolean
There may not be any answers, but the attemt to retrieve them was made.
boolean
hasRedoCode() : boolean
deprecated | Use the ReceptionCode->hasRedoCode |
---|
boolean
hasRedoCopyCode() : boolean
deprecated | Use the ReceptionCode->hasRedoCopyCode |
---|
boolean
hasRelation() : boolean
boolean
hasResult() : boolean
boolean
hasSuccesCode() : boolean
deprecated | Use the ReceptionCode->isSuccess |
---|
boolean
inSource() : boolean
boolean
isCompleted() : boolean
boolean
isCurrentlyValid() : boolean
boolean
isExpired() : boolean
boolean
isNotYetValid() : boolean
boolean
isValidFromManual() : boolean
boolean
True when this date was set by user inputisValidUntilManual() : boolean
boolean
True when this date was set by user inputrefresh(array $gemsData = null
) : \Gems_Tracker_Token
array
Optional, the data refresh with, otherwise refresh from database.
\Gems_Tracker_Token
(continuation pattern)setCompletionTime(string|\MUtil_Date $completionTime, integer $userId) : \Gems_Tracker_Token
string
\MUtil_Date
Completion time as a date or null
integer
The current user
\Gems_Tracker_Token
(continuation pattern)setNextToken(\Gems_Tracker_Token $token) : \Gems_Tracker_Token
\Gems_Tracker_Token
\Gems_Tracker_Token
(continuation pattern)setRawAnswers(array $answers)
array
setReceptionCode(string $code, string $comment, integer $userId) : integer
string
The new (non-success) reception code or a \Gems_Util_ReceptionCode object
string
Comment False values leave value unchanged
integer
The current user
integer
1 if the token has changed, 0 otherwisesetRoundDescription(string $description, integer $userId) : integer
string
The new round description
integer
The current user
integer
1 if data changed, 0 otherwisesetValidFrom(mixed $validFrom, mixed $validUntil, integer $userId) : integer
mixed
\Zend_Date or string
mixed
null, \Zend_Date or string. False values leave values unchangeds
integer
The current user
integer
1 if the token has changed, 0 otherwise_addRelation(\Gems_Tracker_Token_TokenSelect $select)
\Gems_Tracker_Token_TokenSelect
_ensureRespondentData()
_getResultFieldLength() : integer
integer
_updateToken(array $values, integer $userId) : integer
array
The values that this token should be set to
integer
The current user
integer
1 if data changed, 0 otherwisecalculateReturnUrl() : string
This fix allows multiple sites with multiple url's to share a single installation.
string
toResponseDatabase(integer $userId)
Triggered by checkTokenCompletion
integer
The id of the gems user
$exists : boolean
true
$translate : \Zend_Translate
$_gemsData : array
array()
$_loopCheck : boolean
false
$_relation : array
null
$_respondentObject : \Gems_Tracker_Respondent
null
$_tokenId : string
$db : \Zend_Db_Adapter_Abstract
$loader : \Gems_Loader
$locale : \Zend_Locale
$logger : \Gems_Log
$project : \Gems_Project_ProjectSettings
$respTrack : \Gems_Tracker_RespondentTrack
$resultFieldLength : integer
null
$staticResultFieldLength : integer
null
$survey : \Gems_Tracker_Survey
$tracker : \Gems_Tracker
$util : \Gems_Util
$_cache : array
array()
$_nextToken : \Gems_Tracker_Token
null
$_previousToken : \Gems_Tracker_Token
null
$_sourceDataRaw : array
COMPLETION_DATACHANGE = 1
COMPLETION_EVENTCHANGE = 2
COMPLETION_NOCHANGE = 0