LimeSurvey API - Master branch

SurveyLight extends Survey
in package

Class SurveyLight

This is a light version of the normal Survey model, without the afterFindSurvey event. It was created because for mass queries, the afterFindSurvey event is most times not needed and it slows down the process.

Table of Contents

Properties

$active  : string
$active  : string
$additional_languages  : string
$additional_languages  : string
$additionalLanguages  : array<string|int, string>
$additionalLanguages  : array<string|int, string>
$admin  : string
$admin  : string
$adminemail  : string
$adminemail  : string
$allLanguages  : array<string|int, string>
$allLanguages  : array<string|int, string>
$alloweditaftercompletion  : string
$alloweditaftercompletion  : string
$allowprev  : string
$allowprev  : string
$allowregister  : string
$allowregister  : string
$allowsave  : string
$allowsave  : string
$allQuestions  : array<string|int, Question>
$allQuestions  : array<string|int, Question>
$anonymized  : string
$anonymized  : string
$aOptions  : mixed
$assessments  : string
$assessments  : string
$attributedescriptions  : string
$attributedescriptions  : string
$autonumber_start  : int
$autonumber_start  : int
$autoredirect  : string
$autoredirect  : string
$baseQuestions  : array<string|int, Question>
$baseQuestions  : array<string|int, Question>
$bEncryption  : mixed
$bounce_email  : string
$bounce_email  : string
$bounceaccountencryption  : string
$bounceaccountencryption  : string
$bounceaccounthost  : string
$bounceaccounthost  : string
$bounceaccountpass  : string
$bounceaccountpass  : string
$bounceaccounttype  : string
$bounceaccounttype  : string
$bounceaccountuser  : string
$bounceaccountuser  : string
$bounceprocessing  : string
$bounceprocessing  : string
$bouncetime  : int
$bouncetime  : int
$bShowRealOptionValues  : mixed
$countFullAnswers  : int
$countFullAnswers  : int
$countInputQuestions  : int
$countInputQuestions  : int
$countNoInputQuestions  : int
$countNoInputQuestions  : int
$countPartialAnswers  : int
$countPartialAnswers  : int
$countTotalAnswers  : int
$countTotalAnswers  : int
$countTotalQuestions  : int
$countTotalQuestions  : int
$creationDate  : string
$creationDate  : string
$currentLanguageSettings  : SurveyLanguageSetting
$currentLanguageSettings  : SurveyLanguageSetting
$datecreated  : string
$datecreated  : string
$datestamp  : string
$datestamp  : string
$defaultlanguage  : SurveyLanguageSetting
$defaultlanguage  : SurveyLanguageSetting
$emailnotificationto  : string
$emailnotificationto  : string
$emailresponseto  : string
$emailresponseto  : string
$expires  : string
$expires  : string|null
$expiryDateFormatted  : string
$expiryDateFormatted  : string
$format  : string
$format  : string
$googleanalyticsapikey  : string
$googleanalyticsapikey  : string
$googleanalyticsapikeysetting  : string
$googleanalyticsapikeysetting  : string
$googleanalyticsstyle  : string
$googleanalyticsstyle  : string
$groups  : array<string|int, QuestionGroup>
$groups  : array<string|int, QuestionGroup>
$groupsCount  : int
$groupsCount  : int
$gsid  : int
$gsid  : int
$hasResponsesTable  : bool
$hasResponsesTable  : bool
$hasTimingsTable  : bool
$hasTimingsTable  : bool
$hasTokensTable  : bool
$hasTokensTable  : bool
$htmlemail  : string
$htmlemail  : string
$ipaddr  : string
$ipaddr  : string
$ipanonymize  : string
$ipanonymize  : string
$isActive  : bool
$isActive  : bool
$isAllowEditAfterCompletion  : bool
$isAllowEditAfterCompletion  : bool
$isAllowPrev  : bool
$isAllowPrev  : bool
$isAllowRegister  : bool
$isAllowRegister  : bool
$isAllowSave  : bool
$isAllowSave  : bool
$isAnonymized  : bool
$isAnonymized  : bool
$isAssessments  : bool
$isAssessments  : bool
$isAutoRedirect  : bool
$isAutoRedirect  : bool
$isDateExpired  : bool
$isDateExpired  : bool
$isDateStamp  : bool
$isDateStamp  : bool
$isHtmlEmail  : bool
$isHtmlEmail  : bool
$isIpAddr  : bool
$isIpAddr  : bool
$isIpAnonymize  : bool
$isIpAnonymize  : bool
$isListPublic  : bool
$isListPublic  : bool
$isNoKeyboard  : bool
$isNoKeyboard  : bool
$isPrintAnswers  : bool
$isPrintAnswers  : bool
$isPublicGraphs  : bool
$isPublicGraphs  : bool
$isPublicStatistics  : bool
$isPublicStatistics  : bool
$isRefUrl  : bool
$isRefUrl  : bool
$isSaveTimings  : bool
$isSaveTimings  : bool
$isSendConfirmation  : bool
$isSendConfirmation  : bool
$isShowGroupInfo  : bool
$isShowGroupInfo  : bool
$isShowNoAnswer  : bool
$isShowNoAnswer  : bool
$isShowProgress  : bool
$isShowProgress  : bool
$isShowQnumCode  : bool
$isShowQnumCode  : bool
$isShowWelcome  : bool
$isShowWelcome  : bool
$isShowXQuestions  : bool
$isShowXQuestions  : bool
$isTokenAnswersPersistence  : bool
$isTokenAnswersPersistence  : bool
$isUseCookie  : bool
$isUseCookie  : bool
$language  : string
$language  : string
$languagesettings  : array<string|int, SurveyLanguageSetting>
$languagesettings  : array<string|int, SurveyLanguageSetting>
$listpublic  : string
$listpublic  : string
$navigationdelay  : int
$navigationdelay  : int
$nokeyboard  : string
$nokeyboard  : string
$oOptionLabels  : mixed
$oOptions  : mixed
$owner  : User
$owner  : User
$owner_id  : int
$owner_id  : int
$permissions  : array<string|int, Permission>
$permissions  : array<string|int, Permission>
$printanswers  : string
$printanswers  : string
$publicgraphs  : string
$publicgraphs  : string
$publicstatistics  : string
$publicstatistics  : string
$questionindex  : int
$questionindex  : int
$quotableQuestions  : array<string|int, Question>
$quotableQuestions  : array<string|int, Question>
$quotas  : array<string|int, Quota>
$quotas  : array<string|int, Quota>
$refurl  : string
$refurl  : string
$responsesTableName  : string
$responsesTableName  : string
$savetimings  : string
$savetimings  : string
$searched_value  : mixed
$sendconfirmation  : string
$sendconfirmation  : string
$showgroupinfo  : string
$showgroupinfo  : string
$showInherited  : mixed
$shownoanswer  : string
$shownoanswer  : string
$showprogress  : string
$showprogress  : string
$showqnumcode  : string
$showqnumcode  : string
$showsurveypolicynotice  : mixed
$showsurveypolicynotice  : bool
$showsurveypolicynotice  : bool
$showwelcome  : string
$showwelcome  : string
$showxquestions  : string
$showxquestions  : string
$sid  : int
$sid  : int
$startdate  : string
$startdate  : string|null
$startDateFormatted  : string
$startDateFormatted  : string
$surveygroup  : SurveysGroups
$surveyinfo  : array<string|int, mixed>
$surveyinfo  : array<string|int, mixed>
$template  : string
$template  : string
$timingsTableName  : string
$timingsTableName  : string
$tokenanswerspersistence  : string
$tokenanswerspersistence  : string
$tokenAttributes  : array<string|int, mixed>
$tokenAttributes  : array<string|int, mixed>
$tokenencryptionoptions  : string
$tokenencryptionoptions  : string
$tokenlength  : int
$tokenlength  : int
$tokensTableName  : string
$tokensTableName  : string
$usecaptcha  : string
$usecaptcha  : string
$usecookie  : string
$usecookie  : string
$usetokens  : string
$usetokens  : string
$findByPkCache  : array<string|int, mixed>
$xssFilterAttributes  : array<string|int, string>
$sSurveyUrl  : mixed

Methods

active()  : mixed
active()  : mixed
afterFindSurvey()  : mixed
This event is left empty on purpose because we don't in this SurveyLight model we don't want the inherited costly afterFindSurvey event
attributeLabels()  : mixed
behaviors()  : array<string|int, mixed>
Lists the behaviors of this model
calculateEstimatedTime()  : float
Method to make an approximation on how long a survey will last Approx is 3 questions each minute.
checkExpireAfterStart()  : mixed
Validates the Expiration Date is not lower than the Start Date
decrypt()  : mixed
Decrypt values from database
decryptEncryptAttributes()  : mixed
Encrypt/decrypt values
decryptSingle()  : string
Decrypt single value
decryptSingleOld()  : string
Decrypt single value
delete()  : mixed
deleteAllByAttributes()  : int
deleteSurvey()  : bool
Deletes a survey and all its data
dispatchPluginModelEvent()  : PluginEvent
encrypt()  : mixed
Encrypt values
encryptAttributeValues()  : array<string|int, mixed>
Attribute values are encrypted ( if needed )to be used for searching purposes
encryptSave()  : mixed
Encrypt values before saving to the database
encryptSingle()  : mixed
Enrypt single value
expire()  : bool|null
Expires a survey. If the object was invoked using find or new surveyId can be ommited.
filterTemplateSave()  : string
filterTemplateSave to fix some template name
findAllAsArray()  : array<string|int, mixed>
Finds all active records satisfying the specified condition but returns them as array
findAllByAttributes()  : array<string|int, static>
Overriding of Yii's findAllByAttributes method to provide encrypted attribute value search
findAllPublic()  : mixed
findByAttributes()  : static|null
Overriding of Yii's findByAttributes method to provide encrypted attribute value search
findByPk()  : mixed
findQuestionByType()  : Question
fixInvalidQuestions()  : mixed
Fix invalid question in this survey Delete question that don't exist in primary language
getActiveWord()  : string
getAdditionalLanguages()  : array<string|int, mixed>
Returns additional languages formatted into a string
getAliasForLanguage()  : string|null
Returns the survey alias for the specified language.
getAllEncryptedAttributes()  : array<string|int, mixed>
getAllLanguages()  : array<string|int, mixed>
Returns all languages array
getAllQuestions()  : array<string|int, Question>
getAnonymizedResponses()  : string
getBaseQuestions()  : array<string|int, Question>
getButtons()  : string
Returns buttons for gridview.
getCountFullAnswers()  : int|string
getCountInputQuestions()  : int
Get the coutn of questions that need input (skipping text-display etc.)
getCountNoInputQuestions()  : int
Get the coutn of questions that do not need input (skipping text-display etc.)
getCountPartialAnswers()  : int
getCountTotalAnswers()  : int
getCountTotalQuestions()  : int
getCPDBMappings()  : array<string|int, mixed>
This function returns any valid mappings from the survey participants tables to the CPDB in the form of an array [<cpdb_attribute_id>=><participant_table_attribute_name>]
getCreationDate()  : string
getCurrentLanguageSettings()  : SurveyLanguageSetting
The Survey languagesettings in currently active language. Falls back to the surveys' default language if the current language is not available.
getDecodedAttributedescriptions()  : array<string|int, mixed>
decodes the attributedescriptions to be used anywhere necessary
getExpiryDateFormatted()  : string
getGoogleanalyticsapikey()  : string
Returns the value for the SurveyEdit GoogleAnalytics API-Key UseGlobal Setting
getGoogleanalyticsapikeysetting()  : string
Returns the value for the SurveyEdit GoogleAnalytics API-Key UseGlobal Setting
getGroupsCount()  : mixed
Gets number of groups inside a particular survey
getHasResponsesTable()  : bool
Wheteher the survey responses (data) table exists in DB
getHasTimingsTable()  : bool
Wheteher the survey responses timings exists in DB
getHasTokensTable()  : bool
Returns true in a survey participants table exists for survey
getIsActive()  : bool
getIsAllowEditAfterCompletion()  : bool
getIsAllowPrev()  : bool
getIsAllowRegister()  : bool
getIsAllowSave()  : bool
getIsAnonymized()  : bool
getIsAssessments()  : bool
getIsAutoRedirect()  : bool
getIsDateExpired()  : bool
getIsDateStamp()  : bool
getIsHtmlEmail()  : bool
getIsIpAddr()  : bool
getIsIpAnonymize()  : bool
getIsListPublic()  : bool
getIsNoKeyboard()  : bool
getIsPrintAnswers()  : bool
getIsPublicGraphs()  : bool
getIsPublicStatistics()  : bool
getIsRefUrl()  : bool
getIsSaveTimings()  : bool
getIsSendConfirmation()  : bool
getIsShowGroupInfo()  : bool
getIsShowNoAnswer()  : bool
getIsShowProgress()  : bool
getIsShowQnumCode()  : bool
getIsShowWelcome()  : bool
getIsShowXQuestions()  : bool
getIsTokenAnswersPersistence()  : bool
getIsUseCookie()  : bool
getLanguageForSurveyTaking()  : string
Return the language of the current survey It can be: - the selected language by user via the language selector (POST then Session) - the selected language via URL (GET then Session) - the survey default language
getLocalizedTitle()  : mixed
Returns the title of the survey. Uses the current language and falls back to the surveys' default language if the current language is not available.
getMaxId()  : false|int
Return the max value for a field
getMinId()  : false|int
Return the min value for a field
getMinimalPermissionRead()  : null|string
Get minimal permission name (for read value)
getOwnerId()  : int|null
Get the owner id of this record Used for Permission, to be extendable for each model with owner
getOwnerUserName()  : string
getPermissionData()  : array<string|int, mixed>
Get Permission data for Permission object
getQuotableQuestions()  : array<string|int, Question>
getResponsesTableName()  : string
Return the name of survey responses (the data) table name
getRunning()  : string
Returns the status of the survey, including and icon and wrapped by a link to the survey
getsSurveyUrl()  : mixed
TODO: Not used anywhere. Deprecate it?
getStartDateFormatted()  : string
getState()  : string
Get state of survey, which can be one of five: 1. Not active 2. Expired 3. Will expire in the future (running now) 3. Will run in future 4. Running now (no expiration date)
getSurveyMenus()  : array<string|int, mixed>
Get surveymenu configuration from table surveymenu and prepares
getSurveysWithTokenTable()  : array<string|int, Survey>
Get all surveys that has participant table
getSurveyTemplateConfiguration()  : TemplateConfiguration
Returns Survey Template Configuration.
getSurveyUrl()  : string
Returns the survey URL with the specified params.
getTemplateEffectiveName()  : string
Returns the name of the template to be used for the survey.
getTimingsTableName()  : string
Return the name of survey timigs table
getTokenAttributes()  : array<string|int, mixed>
Returns the additional token attributes
getTokenEncryptionOptions()  : array<string|int, mixed>
decodes the tokenencryptionoptions to be used anywhere necessary
getTokensTableName()  : string
Return the name of survey tokens table
hasPermission()  : bool
Get the permission of current model
hasQuestionType()  : bool
Returns true if this survey has any question of type $type.
init()  : mixed
Set defaults
insertNewSurvey()  : Survey
Creates a new survey - with a random sid
model()  : Survey
permission()  : CActiveRecord
permission scope for this model Actually only test if user have minimal access to survey (read)
primaryKey()  : mixed
relations()  : mixed
replacePolicyLink()  : string
Get the final label for survey ID
resetCache()  : void
findByPk uses a cache to store a result. Use this method to force clearing that cache.
rules()  : mixed
saveTranscribeCaptchaOptions()  : string
Transcribe from 3 checkboxes to 1 char for captcha usages Uses variables from $_POST and transferred Surveyobject
scopes()  : mixed
search()  : CActiveDataProvider
Search
setAllowjumps()  : mixed
Attribute renamed to questionindex in dbversion 169 Y maps to 1 otherwise 0;
setEncryptedAttributeLabel()  : string
Function to show encryption symbol in gridview attribute header if value ois encrypted
setGoogleanalyticsapikeysetting()  : void
Sets Google Analytics API Key Setting.
setOptions()  : mixed
setOptionsFromDatabase()  : mixed
setToInherit()  : mixed
setTokenEncryptionOptions()  : mixed
tableName()  : mixed
updateAll()  : int
Updates records with the specified condition.
getPermissionCriteria()  : CDbCriteria
Get criteria from Permission
query()  : mixed
Modified version that default to do the same as the original, but allows via a third parameter to retrieve the result as array instead of active records. This solves a joining problem. Usage via findAllAsArray method
getDateFormatted()  : string
getQuestionOrderCriteria()  : CDbCriteria
Get the DB criteria to get questions as ordered in survey
getSurveyQuestionsCriteria()  : mixed
setAttributeDefaults()  : mixed
shiftedDateTime()  : DateTime|null
Get a dateime DB and return DateTime or null adjusted

Properties

$active

public string $active

Whether survey is acive or not (Y/N)

$active

public string $active

Whether survey is acive or not (Y/N)

$additional_languages

public string $additional_languages

Survey additional languages delimited by space ' '

$additional_languages

public string $additional_languages

Survey additional languages delimited by space ' '

$additionalLanguages

public array<string|int, string> $additionalLanguages

Additional survey languages

$additionalLanguages

public array<string|int, string> $additionalLanguages

Additional survey languages

$admin

public string $admin

Survey Admin's full name

$adminemail

public string $adminemail

Survey administrator email address

$adminemail

public string $adminemail

Survey administrator email address

$allLanguages

public array<string|int, string> $allLanguages

$allLanguages

public array<string|int, string> $allLanguages

$alloweditaftercompletion

public string $alloweditaftercompletion

Allow multiple responses or update responses with one token: (Y/N)

$alloweditaftercompletion

public string $alloweditaftercompletion

Allow multiple responses or update responses with one token: (Y/N)

$allowprev

public string $allowprev

Allow backwards navigation (Y/N)

$allowprev

public string $allowprev

Allow backwards navigation (Y/N)

$allowregister

public string $allowregister

Allow public registration (Y/N)

$allowregister

public string $allowregister

Allow public registration (Y/N)

$allowsave

public string $allowsave

Is participant allowed save and resume later (Y/N)

$allowsave

public string $allowsave

Is participant allowed save and resume later (Y/N)

$allQuestions

public array<string|int, Question> $allQuestions

All survey questions including subquestions

$allQuestions

public array<string|int, Question> $allQuestions

All survey questions including subquestions

$anonymized

public string $anonymized

Whether survey is anonymized or not (Y/N)

$anonymized

public string $anonymized

Whether survey is anonymized or not (Y/N)

$aOptions

public mixed $aOptions = array()

$assessments

public string $assessments

Enable assessment mode: (Y/N)

$assessments

public string $assessments

Enable assessment mode: (Y/N)

$attributedescriptions

public string $attributedescriptions

$attributedescriptions

public string $attributedescriptions

$autonumber_start

public int $autonumber_start

$autoredirect

public string $autoredirect

Automatically load URL when survey complete: (Y/N)

$autoredirect

public string $autoredirect

Automatically load URL when survey complete: (Y/N)

$baseQuestions

public array<string|int, Question> $baseQuestions

Survey questions NOT including subquestions

$baseQuestions

public array<string|int, Question> $baseQuestions

Survey questions NOT including subquestions

$bounce_email

public string $bounce_email

Bounce email address

$bounce_email

public string $bounce_email

Bounce email address

$bounceaccountencryption

public string $bounceaccountencryption

$bounceaccountencryption

public string $bounceaccountencryption

$bounceaccounthost

public string $bounceaccounthost

$bounceaccountpass

public string $bounceaccountpass

$bounceaccounttype

public string $bounceaccounttype

$bounceaccountuser

public string $bounceaccountuser

$bounceprocessing

public string $bounceprocessing

$bouncetime

public int $bouncetime

$bShowRealOptionValues

public mixed $bShowRealOptionValues = \true

$countFullAnswers

public int $countFullAnswers

Full-answers count

$countFullAnswers

public int $countFullAnswers

Full-answers count

$countInputQuestions

public int $countInputQuestions

Count of questions that need input (skipping text-display etc.)

$countInputQuestions

public int $countInputQuestions

Count of questions that need input (skipping text-display etc.)

$countNoInputQuestions

public int $countNoInputQuestions

Count of questions that DO NOT need input (skipping text-display etc.)

All Y/N columns in the model can be accessed as boolean values:

$countNoInputQuestions

public int $countNoInputQuestions

Count of questions that DO NOT need input (skipping text-display etc.)

All Y/N columns in the model can be accessed as boolean values:

$countPartialAnswers

public int $countPartialAnswers

Full-answers count

$countPartialAnswers

public int $countPartialAnswers

Full-answers count

$countTotalAnswers

public int $countTotalAnswers

Total-answers count

$countTotalAnswers

public int $countTotalAnswers

Total-answers count

$countTotalQuestions

public int $countTotalQuestions

Count of questions (in that language, without subquestions)

$countTotalQuestions

public int $countTotalQuestions

Count of questions (in that language, without subquestions)

$creationDate

public string $creationDate

Creation date formatted according to user format

$creationDate

public string $creationDate

Creation date formatted according to user format

$datecreated

public string $datecreated

Date survey was created (YYYY-MM-DD hh:mm:ss)

$datecreated

public string $datecreated

Date survey was created as SQL datetime (YYYY-MM-DD hh:mm:ss)

$datestamp

public string $datestamp

Whether respondents' datestamps will be saved (Y/N)

$datestamp

public string $datestamp

Whether respondents' datestamps will be saved (Y/N)

$emailnotificationto

public string $emailnotificationto

Email address to send basic admin notification email to

$emailnotificationto

public string $emailnotificationto

Email address to send basic admin notification email to

$emailresponseto

public string $emailresponseto

e-mail address to send detailed admin notification email to

$emailresponseto

public string $emailresponseto

e-mail address to send detailed admin notification email to

$expires

public string $expires

Expiry date (YYYY-MM-DD hh:mm:ss)

$expires

public string|null $expires

Expiry date as SQL datetime (YYYY-MM-DD hh:mm:ss)

$expiryDateFormatted

public string $expiryDateFormatted

Expiry date formatted according to user format

$expiryDateFormatted

public string $expiryDateFormatted

Expiry date formatted according to user format

$format

public string $format

A : All in one, G : Group by group, Q : question by question, I : inherit value from survey group

$format

public string $format

A : All in one, G : Group by group, Q : question by question, I : inherit value from survey group

$googleanalyticsapikey

public string $googleanalyticsapikey

Google Analytics Tracking ID

$googleanalyticsapikey

public string $googleanalyticsapikey

Google Analytics Tracking ID

$googleanalyticsapikeysetting

public string $googleanalyticsapikeysetting

Returns the value for the SurveyEdit GoogleAnalytics API-Key UseGlobal Setting

$googleanalyticsapikeysetting

public string $googleanalyticsapikeysetting

Returns the value for the SurveyEdit GoogleAnalytics API-Key UseGlobal Setting

$googleanalyticsstyle

public string $googleanalyticsstyle

Google Analytics style: (0: off; 1:Default; 2:Survey-SID/Group)

$googleanalyticsstyle

public string $googleanalyticsstyle

Google Analytics style: (0: off; 1:Default; 2:Survey-SID/Group)

$groupsCount

public int $groupsCount

Number of groups in a survey (in base language)

$groupsCount

public int $groupsCount

Number of groups in a survey (in base language)

$gsid

public int $gsid

survey group id, from which this survey belongs to and inherits values from when set to 'I'

$gsid

public int $gsid

survey group id, from which this survey belongs to and inherits values from when set to 'I'

$hasResponsesTable

public bool $hasResponsesTable

Wheteher the survey responses (data) table exists in DB

$hasResponsesTable

public bool $hasResponsesTable

Wheteher the survey responses (data) table exists in DB

$hasTimingsTable

public bool $hasTimingsTable

Wheteher the survey timings table exists in DB

$hasTimingsTable

public bool $hasTimingsTable

Wheteher the survey timings table exists in DB

$hasTokensTable

public bool $hasTokensTable

Whether survey has a tokens table or not

$hasTokensTable

public bool $hasTokensTable

Whether survey has a tokens table or not

$htmlemail

public string $htmlemail

Use HTML format for token emails: (Y/N)

$htmlemail

public string $htmlemail

Use HTML format for token emails: (Y/N)

$ipaddr

public string $ipaddr

Whether Participants IP address will be saved: (Y/N)

$ipaddr

public string $ipaddr

Whether Participants IP address will be saved: (Y/N)

$ipanonymize

public string $ipanonymize

Whether id addresses should be anonymized (Y/N)

$ipanonymize

public string $ipanonymize

Whether id addresses should be anonymized (Y/N)

$isActive

public bool $isActive

Whether Survey is active

$isActive

public bool $isActive

Whether Survey is active

$isAllowEditAfterCompletion

public bool $isAllowEditAfterCompletion

Allow multiple responses or update responses with one token

$isAllowEditAfterCompletion

public bool $isAllowEditAfterCompletion

Allow multiple responses or update responses with one token

$isAllowPrev

public bool $isAllowPrev

Allow backwards navigation

$isAllowPrev

public bool $isAllowPrev

Allow backwards navigation

$isAllowRegister

public bool $isAllowRegister

Allow public registration

$isAllowRegister

public bool $isAllowRegister

Allow public registration

$isAllowSave

public bool $isAllowSave

Is participant allowed save and resume later

$isAllowSave

public bool $isAllowSave

Is participant allowed save and resume later

$isAnonymized

public bool $isAnonymized

Whether survey is anonymized or not

$isAnonymized

public bool $isAnonymized

Whether survey is anonymized or not

$isAssessments

public bool $isAssessments

Enable assessment mode

$isAssessments

public bool $isAssessments

Enable assessment mode

$isAutoRedirect

public bool $isAutoRedirect

Automatically load URL when survey complete

$isAutoRedirect

public bool $isAutoRedirect

Automatically load URL when survey complete

$isDateExpired

public bool $isDateExpired

Whether survey is expired depending on the current time and survey configuration status

$isDateExpired

public bool $isDateExpired

Whether survey is expired depending on the current time and survey configuration status

$isDateStamp

public bool $isDateStamp

Whether respondents' datestamps will be saved

$isDateStamp

public bool $isDateStamp

Whether respondents' datestamps will be saved

$isHtmlEmail

public bool $isHtmlEmail

Use HTML format for token emails

$isHtmlEmail

public bool $isHtmlEmail

Use HTML format for token emails

$isIpAddr

public bool $isIpAddr

Whether Participants IP address will be saved

$isIpAddr

public bool $isIpAddr

Whether Participants IP address will be saved

$isIpAnonymize

public bool $isIpAnonymize

Whether Participants IP address will be saved

$isIpAnonymize

public bool $isIpAnonymize

Whether Participants IP address will be saved

$isListPublic

public bool $isListPublic

List survey publicly

$isListPublic

public bool $isListPublic

List survey publicly

$isNoKeyboard

public bool $isNoKeyboard

Show on-screen keyboard

$isNoKeyboard

public bool $isNoKeyboard

Show on-screen keyboard

$isPrintAnswers

public bool $isPrintAnswers

Participants may print answers

$isPrintAnswers

public bool $isPrintAnswers

Participants may print answers

$isPublicGraphs

public bool $isPublicGraphs

Show graphs in public statistics

$isPublicGraphs

public bool $isPublicGraphs

Show graphs in public statistics

$isPublicStatistics

public bool $isPublicStatistics

Public statistics

$isPublicStatistics

public bool $isPublicStatistics

Public statistics

$isRefUrl

public bool $isRefUrl

Save referrer URL

$isSaveTimings

public bool $isSaveTimings

Whether survey timings are saved

$isSaveTimings

public bool $isSaveTimings

Whether survey timings are saved

$isSendConfirmation

public bool $isSendConfirmation

Send confirmation emails

$isSendConfirmation

public bool $isSendConfirmation

Send confirmation emails

$isShowGroupInfo

public bool $isShowGroupInfo

Show group name and/or group description

$isShowGroupInfo

public bool $isShowGroupInfo

Show group name and/or group description

$isShowNoAnswer

public bool $isShowNoAnswer

Show "No answer"

$isShowNoAnswer

public bool $isShowNoAnswer

Show "No answer"

$isShowProgress

public bool $isShowProgress

how progress bar

$isShowProgress

public bool $isShowProgress

how progress bar

$isShowQnumCode

public bool $isShowQnumCode

Show question number and/or code

$isShowQnumCode

public bool $isShowQnumCode

Show question number and/or code

$isShowWelcome

public bool $isShowWelcome

Show welcome screen

$isShowWelcome

public bool $isShowWelcome

Show welcome screen

$isShowXQuestions

public bool $isShowXQuestions

Show "There are X questions in this survey"

$isShowXQuestions

public bool $isShowXQuestions

Show "There are X questions in this survey"

$isTokenAnswersPersistence

public bool $isTokenAnswersPersistence

Enable token-based response persistence

$isTokenAnswersPersistence

public bool $isTokenAnswersPersistence

Enable token-based response persistence

$isUseCookie

public bool $isUseCookie

Are cookies used to prevent repeated participation

$isUseCookie

public bool $isUseCookie

Are cookies used to prevent repeated participation

$language

public string $language

Survey base language

$language

public string $language

Survey base language

$listpublic

public string $listpublic

List survey publicly: (Y/N)

$listpublic

public string $listpublic

List survey publicly: (Y/N)

$navigationdelay

public int $navigationdelay

Navigation delay (seconds) (It shows the number of seconds before the previous, next, and submit buttons are enabled. If none is specified, the option will use the default value, which is "0" (seconds))

$navigationdelay

public int $navigationdelay

Navigation delay (seconds) (It shows the number of seconds before the previous, next, and submit buttons are enabled. If none is specified, the option will use the default value, which is "0" (seconds))

$nokeyboard

public string $nokeyboard

Show on-screen keyboard: (Y/N)

$nokeyboard

public string $nokeyboard

Show on-screen keyboard: (Y/N)

$oOptionLabels

public mixed $oOptionLabels

$oOptions

public mixed $oOptions

$printanswers

public string $printanswers

Participants may print answers: (Y/N)

$printanswers

public string $printanswers

Participants may print answers: (Y/N)

$publicgraphs

public string $publicgraphs

Show graphs in public statistics: (Y/N)

$publicgraphs

public string $publicgraphs

Show graphs in public statistics: (Y/N)

$publicstatistics

public string $publicstatistics

Public statistics: (Y/N)

$publicstatistics

public string $publicstatistics

Public statistics: (Y/N)

$questionindex

public int $questionindex

Show question index / allow jumping (0: diabled; 1: Incremental; 2: Full)

$questionindex

public int $questionindex

Show question index / allow jumping (0: diabled; 1: Incremental; 2: Full)

$refurl

public string $refurl

Save referrer URL: (Y/N)

$refurl

public string $refurl

Save referrer URL: (Y/N)

$responsesTableName

public string $responsesTableName

Name of survey resonses table

$responsesTableName

public string $responsesTableName

Name of survey resonses table

$savetimings

public string $savetimings

Whether survey timings are saved (Y/N)

$savetimings

public string $savetimings

Whether survey timings are saved (Y/N)

$searched_value

public mixed $searched_value

$sendconfirmation

public string $sendconfirmation

Send confirmation emails:(Y/N)

$sendconfirmation

public string $sendconfirmation

Send confirmation emails:(Y/N)

$showgroupinfo

public string $showgroupinfo

Show group name and/or group description: (Y/N)

$showgroupinfo

public string $showgroupinfo

Show group name and/or group description: (Y/N)

$showInherited

public mixed $showInherited = 1

$shownoanswer

public string $shownoanswer

Show "No answer": (Y/N)

$shownoanswer

public string $shownoanswer

Show "No answer": (Y/N)

$showprogress

public string $showprogress

how progress bar: (Y/N)

$showprogress

public string $showprogress

how progress bar: (Y/N)

$showqnumcode

public string $showqnumcode

Show question number and/or code: (Y/N)

$showqnumcode

public string $showqnumcode

Show question number and/or code: (Y/N)

$showsurveypolicynotice

public mixed $showsurveypolicynotice = 0

$showsurveypolicynotice

public bool $showsurveypolicynotice

Show the security notice

$showsurveypolicynotice

public bool $showsurveypolicynotice

Show the security notice

$showwelcome

public string $showwelcome

Show welcome screen: (Y/N)

$showwelcome

public string $showwelcome

Show welcome screen: (Y/N)

$showxquestions

public string $showxquestions

Show "There are X questions in this survey": (Y/N)

$showxquestions

public string $showxquestions

Show "There are X questions in this survey": (Y/N)

$startdate

public string $startdate

Survey Start date (YYYY-MM-DD hh:mm:ss)

$startdate

public string|null $startdate

Survey Start date as SQL datetime (YYYY-MM-DD hh:mm:ss)

$startDateFormatted

public string $startDateFormatted

Start date formatted according to user format

$startDateFormatted

public string $startDateFormatted

Start date formatted according to user format

$surveyinfo

public array<string|int, mixed> $surveyinfo

$surveyinfo

public array<string|int, mixed> $surveyinfo

$template

public string $template

Template name

$timingsTableName

public string $timingsTableName

Name of survey timings table

$timingsTableName

public string $timingsTableName

Name of survey timings table

$tokenanswerspersistence

public string $tokenanswerspersistence

Enable token-based response persistence: (Y/N)

$tokenanswerspersistence

public string $tokenanswerspersistence

Enable token-based response persistence: (Y/N)

$tokenAttributes

public array<string|int, mixed> $tokenAttributes

Additional token attribute names

$tokenAttributes

public array<string|int, mixed> $tokenAttributes

Additional token attribute names

$tokenencryptionoptions

public string $tokenencryptionoptions

Token encryption options

$tokenencryptionoptions

public string $tokenencryptionoptions

Token encryption options

$tokenlength

public int $tokenlength

Token length: MIN:5 MAX:36

$tokenlength

public int $tokenlength

Token length: MIN:5 MAX:36

$tokensTableName

public string $tokensTableName

Name of survey tokens table

$tokensTableName

public string $tokensTableName

Name of survey tokens table

$usecaptcha

public string $usecaptcha

$usecookie

public string $usecookie

Are cookies used to prevent repeated participation (Y/N)

$usecookie

public string $usecookie

Are cookies used to prevent repeated participation (Y/N)

$usetokens

public string $usetokens

$findByPkCache

protected static array<string|int, mixed> $findByPkCache = []

$xssFilterAttributes

protected array<string|int, string> $xssFilterAttributes = []

Array of attributes that should be XSS filtered on mass updates

$sSurveyUrl

private mixed $sSurveyUrl

Methods

afterFindSurvey()

This event is left empty on purpose because we don't in this SurveyLight model we don't want the inherited costly afterFindSurvey event

public afterFindSurvey() : mixed

attributeLabels()

public attributeLabels() : mixed
Tags
inheritdoc

behaviors()

Lists the behaviors of this model

public behaviors() : array<string|int, mixed>

Below is a list of all behaviors we register:

Tags
see
PluginEventBehavior
see
CTimestampBehavior
Return values
array<string|int, mixed>

calculateEstimatedTime()

Method to make an approximation on how long a survey will last Approx is 3 questions each minute.

public calculateEstimatedTime() : float
Tags
deprecated

Unused since 3.X

Return values
float

checkExpireAfterStart()

Validates the Expiration Date is not lower than the Start Date

public checkExpireAfterStart(mixed $attributes, mixed $params) : mixed
Parameters
$attributes : mixed
$params : mixed

decrypt()

Decrypt values from database

public decrypt([mixed $value = '' ]) : mixed
Parameters
$value : mixed = ''

decryptEncryptAttributes()

Encrypt/decrypt values

public decryptEncryptAttributes([mixed $action = 'decrypt' ]) : mixed
Parameters
$action : mixed = 'decrypt'

decryptSingle()

Decrypt single value

public static decryptSingle([string $value = '' ]) : string
Parameters
$value : string = ''

String value which needs to be decrypted

Return values
string

the decrypted string

decryptSingleOld()

Decrypt single value

public static decryptSingleOld([string $value = '' ]) : string
Parameters
$value : string = ''

String value which needs to be decrypted

Return values
string

the decrypted string

delete()

public delete([bool $recursive = true ]) : mixed
Parameters
$recursive : bool = true
Tags
inheritdoc

With allow to delete all related models and data and test Permission.

deleteAllByAttributes()

public deleteAllByAttributes(array<string|int, mixed> $attributes[, string $condition = '' ][, array<string|int, mixed> $params = [] ]) : int
Parameters
$attributes : array<string|int, mixed>

list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.

$condition : string = ''

query condition or criteria.

$params : array<string|int, mixed> = []

parameters to be bound to an SQL statement.

Tags
todo

This should also be moved to the behavior at some point. This method overrides the parent in order to raise PluginEvents for Bulk delete operations.

Filter Criteria are wrapped into a CDBCriteria instance so we have a single instance responsible for holding the filter criteria to be passed to the PluginEvent, this also enables us to pass the fully configured CDBCriteria instead of the original Parameters.

See for detailed explanation about $condition and $params.

Return values
int

number of rows affected by the execution.

deleteSurvey()

Deletes a survey and all its data

public deleteSurvey(int $iSurveyID[, bool $recursive = true ]) : bool
Parameters
$iSurveyID : int
$recursive : bool = true
Tags
access

public

Return values
bool

dispatchPluginModelEvent()

public dispatchPluginModelEvent(string $sEventName, CDbCriteria $criteria = null, array<string|int, mixed> $eventParams = []) : PluginEvent
Parameters
$sEventName : string
$criteria = null : CDbCriteria
$eventParams = [] : array<string|int, mixed>
Return values
PluginEvent

encryptAttributeValues()

Attribute values are encrypted ( if needed )to be used for searching purposes

public encryptAttributeValues([array<string|int, mixed> $attributes = null ][, mixed $bEncryptedOnly = false ][, mixed $bReplaceValues = true ]) : array<string|int, mixed>
Parameters
$attributes : array<string|int, mixed> = null

list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.

$bEncryptedOnly : mixed = false
$bReplaceValues : mixed = true
Return values
array<string|int, mixed>

attributes array with encrypted atrribute values is returned

encryptSave()

Encrypt values before saving to the database

public encryptSave([mixed $runValidation = false ]) : mixed
Parameters
$runValidation : mixed = false

encryptSingle()

Enrypt single value

public static encryptSingle([string $value = '' ]) : mixed
Parameters
$value : string = ''

String value which needs to be encrypted

expire()

Expires a survey. If the object was invoked using find or new surveyId can be ommited.

public expire([int $surveyId = null ]) : bool|null
Parameters
$surveyId : int = null

Survey ID

Return values
bool|null

filterTemplateSave()

filterTemplateSave to fix some template name

public filterTemplateSave(string $sTemplateName) : string
Parameters
$sTemplateName : string
Return values
string

findAllAsArray()

Finds all active records satisfying the specified condition but returns them as array

public findAllAsArray([mixed $condition = '' ][, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>

See for detailed explanation about $condition and $params.

Parameters
$condition : mixed = ''

query condition or criteria.

$params : array<string|int, mixed> = []

parameters to be bound to an SQL statement.

Return values
array<string|int, mixed>

list of active records satisfying the specified condition. An empty array is returned if none is found.

findAllByAttributes()

Overriding of Yii's findAllByAttributes method to provide encrypted attribute value search

public findAllByAttributes(array<string|int, mixed> $attributes[, mixed $condition = '' ][, array<string|int, mixed> $params = [] ]) : array<string|int, static>
Parameters
$attributes : array<string|int, mixed>

list of attribute values (indexed by attribute names) that the active records should match. An attribute value can be an array which will be used to generate an IN condition.

$condition : mixed = ''

query condition or criteria.

$params : array<string|int, mixed> = []

parameters to be bound to an SQL statement.

Return values
array<string|int, static>

the records found. An empty array is returned if none is found.

findAllPublic()

public findAllPublic() : mixed

findByAttributes()

Overriding of Yii's findByAttributes method to provide encrypted attribute value search

public findByAttributes(array<string|int, mixed> $attributes[, mixed $condition = '' ][, array<string|int, mixed> $params = [] ]) : static|null
Parameters
$attributes : array<string|int, mixed>

list of attribute values (indexed by attribute names) that the active record should match. An attribute value can be an array which will be used to generate an IN condition.

$condition : mixed = ''

query condition or criteria.

$params : array<string|int, mixed> = []

parameters to be bound to an SQL statement.

Return values
static|null

the record found. Null if none is found.

findByPk()

public findByPk(mixed $pk[, mixed $condition = '' ][, mixed $params = array() ]) : mixed
Parameters
$pk : mixed
$condition : mixed = ''
$params : mixed = array()
Tags
inheritdoc

. But use a static var because can be used a lot of time.

findQuestionByType()

public findQuestionByType(string $type[, bool $includeSubquestions = false ]) : Question
Parameters
$type : string

Question->type

$includeSubquestions : bool = false
Return values
Question

fixInvalidQuestions()

Fix invalid question in this survey Delete question that don't exist in primary language

public fixInvalidQuestions() : mixed

getActiveWord()

public getActiveWord() : string
Return values
string

getAdditionalLanguages()

Returns additional languages formatted into a string

public getAdditionalLanguages() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

getAliasForLanguage()

Returns the survey alias for the specified language.

public getAliasForLanguage([string|null $language = null ]) : string|null
Parameters
$language : string|null = null
Return values
string|null

getAllEncryptedAttributes()

public getAllEncryptedAttributes(int $iSurveyId, string $sClassName) : array<string|int, mixed>
Parameters
$iSurveyId : int
$sClassName : string
Return values
array<string|int, mixed>

TODO: Should be split into seperate functions in the appropiate model or helper class TODO: Make an interface for records that support encryption.

getAllLanguages()

Returns all languages array

public getAllLanguages() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

getAllQuestions()

public getAllQuestions() : array<string|int, Question>
Return values
array<string|int, Question>

getAnonymizedResponses()

public getAnonymizedResponses() : string
Return values
string

getBaseQuestions()

public getBaseQuestions() : array<string|int, Question>
Return values
array<string|int, Question>

getButtons()

Returns buttons for gridview.

public getButtons() : string
Tags
throws
CException
throws
Exception
Return values
string

getCountFullAnswers()

public getCountFullAnswers() : int|string
Return values
int|string

getCountInputQuestions()

Get the coutn of questions that need input (skipping text-display etc.)

public getCountInputQuestions() : int
Return values
int

getCountNoInputQuestions()

Get the coutn of questions that do not need input (skipping text-display etc.)

public getCountNoInputQuestions() : int
Return values
int

getCountPartialAnswers()

public getCountPartialAnswers() : int
Return values
int

getCountTotalAnswers()

public getCountTotalAnswers() : int
Return values
int

getCountTotalQuestions()

public getCountTotalQuestions() : int
Return values
int

getCPDBMappings()

This function returns any valid mappings from the survey participants tables to the CPDB in the form of an array [<cpdb_attribute_id>=><participant_table_attribute_name>]

public getCPDBMappings() : array<string|int, mixed>
Return values
array<string|int, mixed>

Array of mappings

getCreationDate()

public getCreationDate() : string
Return values
string

formatted date

getCurrentLanguageSettings()

The Survey languagesettings in currently active language. Falls back to the surveys' default language if the current language is not available.

public getCurrentLanguageSettings() : SurveyLanguageSetting
Return values
SurveyLanguageSetting

getDecodedAttributedescriptions()

decodes the attributedescriptions to be used anywhere necessary

public getDecodedAttributedescriptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getExpiryDateFormatted()

public getExpiryDateFormatted() : string
Return values
string

formatted date

getGoogleanalyticsapikey()

Returns the value for the SurveyEdit GoogleAnalytics API-Key UseGlobal Setting

public getGoogleanalyticsapikey() : string
Return values
string

getGoogleanalyticsapikeysetting()

Returns the value for the SurveyEdit GoogleAnalytics API-Key UseGlobal Setting

public getGoogleanalyticsapikeysetting() : string
Return values
string

getGroupsCount()

Gets number of groups inside a particular survey

public getGroupsCount() : mixed

getHasResponsesTable()

Wheteher the survey responses (data) table exists in DB

public getHasResponsesTable() : bool
Return values
bool

getHasTimingsTable()

Wheteher the survey responses timings exists in DB

public getHasTimingsTable() : bool
Return values
bool

getHasTokensTable()

Returns true in a survey participants table exists for survey

public getHasTokensTable() : bool
Return values
bool

getIsActive()

public getIsActive() : bool
Return values
bool

getIsAllowEditAfterCompletion()

public getIsAllowEditAfterCompletion() : bool
Return values
bool

getIsAllowPrev()

public getIsAllowPrev() : bool
Return values
bool

getIsAllowRegister()

public getIsAllowRegister() : bool
Return values
bool

getIsAllowSave()

public getIsAllowSave() : bool
Return values
bool

getIsAnonymized()

public getIsAnonymized() : bool
Return values
bool

getIsAssessments()

public getIsAssessments() : bool
Return values
bool

getIsAutoRedirect()

public getIsAutoRedirect() : bool
Return values
bool

getIsDateExpired()

public getIsDateExpired() : bool
Tags
throws
Exception
Return values
bool

getIsDateStamp()

public getIsDateStamp() : bool
Return values
bool

getIsHtmlEmail()

public getIsHtmlEmail() : bool
Return values
bool

getIsIpAddr()

public getIsIpAddr() : bool
Return values
bool

getIsIpAnonymize()

public getIsIpAnonymize() : bool
Return values
bool

getIsListPublic()

public getIsListPublic() : bool
Return values
bool

getIsNoKeyboard()

public getIsNoKeyboard() : bool
Return values
bool

getIsPrintAnswers()

public getIsPrintAnswers() : bool
Return values
bool

getIsPublicGraphs()

public getIsPublicGraphs() : bool
Return values
bool

getIsPublicStatistics()

public getIsPublicStatistics() : bool
Return values
bool

getIsRefUrl()

public getIsRefUrl() : bool
Return values
bool

getIsSaveTimings()

public getIsSaveTimings() : bool
Return values
bool

getIsSendConfirmation()

public getIsSendConfirmation() : bool
Return values
bool

getIsShowGroupInfo()

public getIsShowGroupInfo() : bool
Return values
bool

getIsShowNoAnswer()

public getIsShowNoAnswer() : bool
Return values
bool

getIsShowProgress()

public getIsShowProgress() : bool
Return values
bool

getIsShowQnumCode()

public getIsShowQnumCode() : bool
Return values
bool

getIsShowWelcome()

public getIsShowWelcome() : bool
Return values
bool

getIsShowXQuestions()

public getIsShowXQuestions() : bool
Return values
bool

getIsTokenAnswersPersistence()

public getIsTokenAnswersPersistence() : bool
Return values
bool

getIsUseCookie()

public getIsUseCookie() : bool
Return values
bool

getLanguageForSurveyTaking()

Return the language of the current survey It can be: - the selected language by user via the language selector (POST then Session) - the selected language via URL (GET then Session) - the survey default language

public getLanguageForSurveyTaking() : string
Return values
string

the correct language

getLocalizedTitle()

Returns the title of the survey. Uses the current language and falls back to the surveys' default language if the current language is not available.

public getLocalizedTitle() : mixed

getMaxId()

Return the max value for a field

public getMaxId([string $field = null ][, bool $forceRefresh = false ]) : false|int

This is a convenience method, that uses the primary key of the model to retrieve the highest value.

Parameters
$field : string = null

The field that contains the Id, when null primary key is used if it is a single field

$forceRefresh : bool = false

Don't use value from static cache but always requery the database

Tags
throws
Exception
Return values
false|int

getMinId()

Return the min value for a field

public getMinId([string $field = null ][, bool $forceRefresh = false ]) : false|int

This is a convenience method, that uses the primary key of the model to retrieve the highest value.

Parameters
$field : string = null

The field that contains the Id, when null primary key is used if it is a single field

$forceRefresh : bool = false

Don't use value from static cache but always requery the database

Tags
throws
Exception
Return values
false|int

getMinimalPermissionRead()

Get minimal permission name (for read value)

public static getMinimalPermissionRead() : null|string
Return values
null|string

getOwnerId()

Get the owner id of this record Used for Permission, to be extendable for each model with owner

public getOwnerId() : int|null
Return values
int|null

getOwnerUserName()

public getOwnerUserName() : string
Return values
string

getPermissionData()

Get Permission data for Permission object

public static getPermissionData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getQuotableQuestions()

public getQuotableQuestions() : array<string|int, Question>
Return values
array<string|int, Question>

getResponsesTableName()

Return the name of survey responses (the data) table name

public getResponsesTableName() : string
Return values
string

getRunning()

Returns the status of the survey, including and icon and wrapped by a link to the survey

public getRunning() : string
Tags
throws
Exception
Return values
string

getsSurveyUrl()

TODO: Not used anywhere. Deprecate it?

public getsSurveyUrl() : mixed

getStartDateFormatted()

public getStartDateFormatted() : string
Return values
string

formatted date

getState()

Get state of survey, which can be one of five: 1. Not active 2. Expired 3. Will expire in the future (running now) 3. Will run in future 4. Running now (no expiration date)

public getState() : string

Code copied from getRunning below.

Return values
string
  • 'inactive', 'expired', 'willRun', 'willExpire' or 'running'

getSurveyMenus()

Get surveymenu configuration from table surveymenu and prepares

public getSurveyMenus([string $position = '' ]) : array<string|int, mixed>
Parameters
$position : string = ''

Position

Tags
todo

this function can go directly into Surveymenu, why implemted it here? ($this is used here ...) This will be made bigger in future releases, but right now it only collects the default menu-entries

Return values
array<string|int, mixed>

getSurveysWithTokenTable()

Get all surveys that has participant table

public static getSurveysWithTokenTable() : array<string|int, Survey>
Return values
array<string|int, Survey>

getSurveyUrl()

Returns the survey URL with the specified params.

public getSurveyUrl([string|null $language = null ][, array<string|int, mixed>|string|mixed $params = [] ][, bool $preferShortUrl = true ]) : string

If $preferShortUrl is true (default), and an alias is available, it returns the short version of the URL.

Parameters
$language : string|null = null
$params : array<string|int, mixed>|string|mixed = []

Optional parameters to include in the URL.

$preferShortUrl : bool = true

If true, tries to return the short URL instead of the traditional one.

Return values
string

getTemplateEffectiveName()

Returns the name of the template to be used for the survey.

public getTemplateEffectiveName() : string

It resolves inheritance from group and from default settings.

Tags
todo:

Cache this on a private attribute?

Return values
string

getTimingsTableName()

Return the name of survey timigs table

public getTimingsTableName() : string
Return values
string

getTokenAttributes()

Returns the additional token attributes

public getTokenAttributes() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

getTokenEncryptionOptions()

decodes the tokenencryptionoptions to be used anywhere necessary

public getTokenEncryptionOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTokensTableName()

Return the name of survey tokens table

public getTokensTableName() : string
Return values
string

hasPermission()

Get the permission of current model

public hasPermission(string $sPermission[, string $sCRUD = 'read' ][, int $iUserID = null ]) : bool
Parameters
$sPermission : string

Name of the permission

$sCRUD : string = 'read'

The permission detail you want to check on: 'create','read','update','delete','import' or 'export'

$iUserID : int = null

User ID - if not given the one of the current user is used

Return values
bool

hasQuestionType()

Returns true if this survey has any question of type $type.

public hasQuestionType(string $type[, bool $includeSubquestions = false ]) : bool
Parameters
$type : string

Question type, like 'L', 'T', etc.

$includeSubquestions : bool = false

If true, will also check the types of subquestions.

Tags
throws
CException
Return values
bool

init()

Set defaults

public init() : mixed
Tags
inheritdoc

insertNewSurvey()

Creates a new survey - with a random sid

public insertNewSurvey(array<string|int, mixed> $aData) : Survey
Parameters
$aData : array<string|int, mixed>

Array with fieldname=>fieldcontents data

Return values
Survey

model()

public static model([mixed $className = __CLASS__ ]) : Survey
Parameters
$className : mixed = __CLASS__
Tags
inheritdoc
Return values
Survey

permission()

permission scope for this model Actually only test if user have minimal access to survey (read)

public permission(int $loginID) : CActiveRecord
Parameters
$loginID : int
Tags
see
issue

https://bugs.limesurvey.org/view.php?id=16799

access

public

Return values
CActiveRecord

primaryKey()

public primaryKey() : mixed
Tags
inheritdoc

relations()

public relations() : mixed
Tags
inheritdoc

Get the final label for survey ID

public static replacePolicyLink(string $dataSecurityNoticeLabel, int $surveyId) : string
Parameters
$dataSecurityNoticeLabel : string

current label

$surveyId : int

unused

Return values
string

resetCache()

findByPk uses a cache to store a result. Use this method to force clearing that cache.

public resetCache() : void

rules()

public rules() : mixed
Tags
inheritdoc

saveTranscribeCaptchaOptions()

Transcribe from 3 checkboxes to 1 char for captcha usages Uses variables from $_POST and transferred Surveyobject

public static saveTranscribeCaptchaOptions([Survey $oSurvey = null ]) : string

'A' = All three captcha enabled 'B' = All but save and load 'C' = All but registration 'D' = All but survey access 'X' = Only survey access 'R' = Only registration 'S' = Only save and load

'E' = All inherited 'F' = Inherited save and load + survey access + registration 'G' = Inherited survey access + registration + save and load 'H' = Inherited registration + save and load + survey access 'I' = Inherited save and load + inherited survey access + registration 'J' = Inherited survey access + inherited registration + save and load 'K' = Inherited registration + inherited save and load + survey access

'L' = Inherited survey access + save and load 'M' = Inherited survey access + registration 'O' = Inherited registration + survey access '1' = Inherited survey access + inherited registration '2' = Inherited survey access + inherited save and load '3' = Inherited registration + inherited save and load '4' = Inherited survey access '5' = Inherited save and load '6' = Inherited registration

'N' = None

Parameters
$oSurvey : Survey = null
Tags
todo

Should really be saved as three fields in the database!

Return values
string

One character that corresponds to captcha usage

scopes()

public scopes() : mixed
Tags
inheritdoc

Search

public search([array<string|int, mixed> $options = [] ]) : CActiveDataProvider

$options = [ 'pageSize' => 10, 'currentPage' => 1 ];

Parameters
$options : array<string|int, mixed> = []
Return values
CActiveDataProvider

setAllowjumps()

Attribute renamed to questionindex in dbversion 169 Y maps to 1 otherwise 0;

public setAllowjumps(string $value) : mixed
Parameters
$value : string

setEncryptedAttributeLabel()

Function to show encryption symbol in gridview attribute header if value ois encrypted

public setEncryptedAttributeLabel(int $surveyId, string $className, string $attributeName) : string
Parameters
$surveyId : int
$className : string
$attributeName : string
Tags
throws
CException
Return values
string

setGoogleanalyticsapikeysetting()

Sets Google Analytics API Key Setting.

public setGoogleanalyticsapikeysetting(string $value) : void
Parameters
$value : string

Google Analytics Key

setOptions()

public setOptions([mixed $gsid = 1 ]) : mixed
Parameters
$gsid : mixed = 1

setOptionsFromDatabase()

public setOptionsFromDatabase() : mixed

setToInherit()

public setToInherit() : mixed

setTokenEncryptionOptions()

public setTokenEncryptionOptions(mixed $options) : mixed
Parameters
$options : mixed

tableName()

public tableName() : mixed
Tags
inheritdoc

updateAll()

Updates records with the specified condition.

public updateAll(array<string|int, mixed> $attributes[, mixed $condition = '' ][, array<string|int, mixed> $params = array() ]) : int

XSS filtering is enforced for attributes listed in model's $xssFilterAttributes property. See for detailed explanation about $condition and $params. Note, the attributes are not checked for safety and no validation is done.

Parameters
$attributes : array<string|int, mixed>

list of attributes (name=>$value) to be updated

$condition : mixed = ''

query condition or criteria.

$params : array<string|int, mixed> = array()

parameters to be bound to an SQL statement.

Return values
int

the number of rows being updated

getPermissionCriteria()

Get criteria from Permission

protected static getPermissionCriteria([ $userid = null ]) : CDbCriteria
Parameters
$userid : = null

for thius user id , if not set : get current one

Tags
todo

: move to PermissionInterface

todo

: create an event

Return values
CDbCriteria

query()

Modified version that default to do the same as the original, but allows via a third parameter to retrieve the result as array instead of active records. This solves a joining problem. Usage via findAllAsArray method

protected query(CDbCriteria $criteria[, bool $all = false ][, bool $asAR = true ]) : mixed

Performs the actual DB query and populates the AR objects with the query result. This method is mainly internally used by other AR query methods.

Parameters
$criteria : CDbCriteria

the query criteria

$all : bool = false

whether to return all data

$asAR : bool = true
Tags
since
1.1.7
Return values
mixed

the AR objects populated with the query result

getDateFormatted()

private getDateFormatted(string $attribute) : string
Parameters
$attribute : string

date attribute name

Return values
string

formatted date

getQuestionOrderCriteria()

Get the DB criteria to get questions as ordered in survey

private getQuestionOrderCriteria() : CDbCriteria
Return values
CDbCriteria

getSurveyQuestionsCriteria()

private getSurveyQuestionsCriteria() : mixed

setAttributeDefaults()

private setAttributeDefaults() : mixed

shiftedDateTime()

Get a dateime DB and return DateTime or null adjusted

private static shiftedDateTime(mixed $datetime) : DateTime|null
Parameters
$datetime : mixed
Return values
DateTime|null

        
On this page

Search results