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)
mixedToken Id or array containing token record
__get(string $name) : Callable
string
CallableapplyToMenuSource(\Gems_Menu_ParameterSource $source) : \Gems_Tracker_Token
\Gems_Menu_ParameterSource
\Gems_Tracker_Token(continuation pattern)assignTo(integer $respondentRelationId, integer $relationFieldId) : integer
integer
integer
integer1 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.
stringThe key used in the cache
mixedThe optional default value to use when it is not present
mixedcacheHas(string $key) : boolean
string
booleancacheReset(string|null $key = null)
You can pass in an optional $key parameter to reset just that key, otherwise all the cache will be reset
stringnullThe key to reset
cacheSet(string $key, mixed $value)
string
mixed
checkRegistryRequestsAnswers() : boolean
booleanFalse if required are missing.checkTokenCompletion(integer $userId) : integer
integerThe id of the gems user
integerself::COMPLETION_NOCHANGE || (self::COMPLETION_DATACHANGE | self::COMPLETION_EVENTCHANGE)createReplacement(string $newComment, integer $userId) : string
Returns the new token id
stringDescription of why the token was replaced
integerThe current user
stringThe new tokengetAllUnansweredTokens($where = '') : array
Similar to @see $this->getNextUnansweredToken() Similar to @see $this->getTokenCountUnanswered()
arrayof tokendatagetAnswerDateTime(string $fieldName) : \MUtil_Date
stringName of answer field
\MUtil_Datedate time or nullgetAnswerSnippetNames() : string
stringgetArrayCopy() : array
arraygetChangedBy() : integer
integergetComment() : string
stringgetCompletionTime() : \MUtil_Date
\MUtil_DateCompletion time as a date or nullgetConsentCode() : string
stringgetCreatedBy() : integer
integergetDateTime(string $fieldName) : \MUtil_Date
string
\MUtil_DategetDeleteSnippetNames() : array
arrayof stringsgetEditSnippetNames() : array
arrayof stringsgetEmail() : string | null
This method will return null when no address available
stringnullEmail address of the person who needs to fill out the survey or nullgetMailSentDate() : string
stringLast mail sent dategetModel() : \Gems_Tracker_Model_StandardTokenModel
\Gems_Tracker_Model_StandardTokenModelgetNextToken() : \Gems_Tracker_Token
\Gems_Tracker_TokengetNextUnansweredToken() : \Gems_Tracker_Token
\Gems_Tracker_TokengetOrganization() : \Gems_User_Organization
\Gems_User_OrganizationgetOrganizationId() : integer
integergetPatientNumber() : string
stringThe respondents patient numbergetPreviousSuccessToken() : \Gems_Tracker_Token
\Gems_Tracker_TokengetPreviousToken() : \Gems_Tracker_Token
\Gems_Tracker_TokengetRawAnswers() : array
Function may return more fields than just the answers.
arrayField => Value arraygetReceptionCode() : \Gems_Util_ReceptionCode
\Gems_Util_ReceptionCodereception codegetRelation() : \Gems_Model_RespondentRelationInstance
\Gems_Model_RespondentRelationInstancegetRelationFieldId() : integer
This is not the id of the relation, but the id of the trackfield that defines the relation.
integergetRelationFieldName() : string
stringgetRelationId() : integer
integergetRespondent() : \Gems_Tracker_Respondent
\Gems_Tracker_RespondentgetRespondentGender() : string
stringgetRespondentGenderHello() : string
stringgetRespondentId() : integer
integergetRespondentLanguage() : string
stringTwo letter language codegetRespondentLastName() : string
stringgetRespondentName() : string
Could be the patient or the relation when assigned to one
stringgetRespondentTrack() : \Gems_Tracker_RespondentTrack
\Gems_Tracker_RespondentTrackgetRespondentTrackId() : integer
integergetReturnUrl() : string
stringgetRoundCode() : string | null
stringnullNull when no round id is present or round no longer existsgetRoundDescription() : string
stringRound descriptiongetRoundId() : integer
integerround idgetRoundOrder() : integer
integerround ordergetShowSnippetNames() : string
stringgetStatus() : string
stringToken status descriptiongetSubjectname() : string
To be used when there is a relation and you need to know the name of the respondent
stringgetSurvey() : \Gems_Tracker_Survey
\Gems_Tracker_SurveygetSurveyAnswerModel(string $language) : \MUtil_Model_ModelAbstract
string(ISO) language string
\MUtil_Model_ModelAbstractgetSurveyId() : integer
integerGems survey idgetSurveyName() : string
stringName of the surveygetTokenCountUnanswered() : integer
integergetTokenId() : string
stringtokengetTrackEngine() : \Gems_Tracker_Engine_TrackEngineInterface
\Gems_Tracker_Engine_TrackEngineInterfacegetTrackId() : integer
integergems_tracks track idgetTrackName()
getUrl(string $language, integer $userId)
stringThe language currently used by the user
integerThe id of the gems user
\Gems_Tracker_Source_SurveyNotFoundException |
|---|
getValidFrom() : \MUtil_Date
\MUtil_DateValid from as a date or nullgetValidUntil() : \MUtil_Date
\MUtil_DateValid until as a date or nullhandleAfterCompletion() : array
arrayThe changed valueshandleBeforeAnswering() : array
arrayThe changed valueshasAnswersLoaded() : boolean
There may not be any answers, but the attemt to retrieve them was made.
booleanhasRedoCode() : boolean
| deprecated | Use the ReceptionCode->hasRedoCode |
|---|
booleanhasRedoCopyCode() : boolean
| deprecated | Use the ReceptionCode->hasRedoCopyCode |
|---|
booleanhasRelation() : boolean
booleanhasResult() : boolean
booleanhasSuccesCode() : boolean
| deprecated | Use the ReceptionCode->isSuccess |
|---|
booleaninSource() : boolean
booleanisCompleted() : boolean
booleanisCurrentlyValid() : boolean
booleanisExpired() : boolean
booleanisNotYetValid() : boolean
booleanisValidFromManual() : boolean
booleanTrue when this date was set by user inputisValidUntilManual() : boolean
booleanTrue when this date was set by user inputrefresh(array $gemsData = null) : \Gems_Tracker_Token
arrayOptional, 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_DateCompletion time as a date or null
integerThe 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
stringThe new (non-success) reception code or a \Gems_Util_ReceptionCode object
stringComment False values leave value unchanged
integerThe current user
integer1 if the token has changed, 0 otherwisesetRoundDescription(string $description, integer $userId) : integer
stringThe new round description
integerThe current user
integer1 if data changed, 0 otherwisesetValidFrom(mixed $validFrom, mixed $validUntil, integer $userId) : integer
mixed\Zend_Date or string
mixednull, \Zend_Date or string. False values leave values unchangeds
integerThe current user
integer1 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
arrayThe values that this token should be set to
integerThe current user
integer1 if data changed, 0 otherwisecalculateReturnUrl() : string
This fix allows multiple sites with multiple url's to share a single installation.
stringtoResponseDatabase(integer $userId)
Triggered by checkTokenCompletion
integerThe 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