SurveysGroupsettings
extends LSActiveRecord
in package
This is the model class for table "{{surveys_groupsettings}}".
The following are the available columns in table '{{surveys_groupsettings}}':
Table of Contents
Properties
- $active : mixed
- $additional_languages : mixed
- $admin : string
- $adminemail : string
- $alloweditaftercompletion : string
- $allowprev : string
- $allowregister : string
- $allowsave : string
- $anonymized : string
- $aOptions : mixed
- $assessments : string
- $attributedescriptions : string
- $autonumber_start : int
- $autoredirect : string
- $bEncryption : mixed
- $bounce_email : string
- $datecreated : string
- $datestamp : string
- $emailnotificationto : string
- $emailresponseto : string
- $expires : string
- $format : string
- $gsid : int
- $htmlemail : string
- $ipaddr : string
- $ipanonymize : string
- $listpublic : string
- $navigationdelay : int
- $nokeyboard : string
- $oOptionLabels : mixed
- $oOptions : mixed
- $owner_id : int
- $printanswers : string
- $publicgraphs : string
- $publicstatistics : string
- $questionindex : int
- $refurl : string
- $savetimings : string
- $sendconfirmation : string
- $showgroupinfo : string
- $showInherited : mixed
- $shownoanswer : string
- $showprogress : string
- $showqnumcode : string
- $showsurveypolicynotice : int
- $showwelcome : string
- $showxquestions : string
- $startdate : string
- $template : string
- $tokenanswerspersistence : string
- $tokenlength : int
- $usecaptcha : string
- $usecookie : string
- $optionAttributes : mixed
- $optionAttributesChar : mixed
- $optionAttributesInteger : mixed
- $optionAttributesText : mixed
- $xssFilterAttributes : array<string|int, string>
- $aSurveysGroupSettings : mixed
Methods
- attributeLabels() : array<string|int, mixed>
- behaviors() : array<string|int, mixed>
- Lists the behaviors of this model
- decrypt() : mixed
- Decrypt values from database
- decryptEncryptAttributes() : mixed
- Encrypt/decrypt values
- decryptSingle() : string
- Decrypt single value
- decryptSingleOld() : string
- Decrypt single value
- deleteAllByAttributes() : int
- 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
- 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
- findByAttributes() : static|null
- Overriding of Yii's findByAttributes method to provide encrypted attribute value search
- getAllEncryptedAttributes() : array<string|int, mixed>
- getInstance() : SurveysGroupsettings
- Recursive function
- getIsActive() : bool
- getIsAnonymized() : bool
- getMaxId() : false|int
- Return the max value for a field
- getMinId() : false|int
- Return the min value for a field
- model() : SurveysGroupsettings
- Returns the static model of the specified AR class.
- relations() : array<string|int, mixed>
- rules() : array<string|int, mixed>
- save() : mixed
- search() : CActiveDataProvider
- Retrieves a list of models based on the current search/filter conditions.
- setEncryptedAttributeLabel() : string
- Function to show encryption symbol in gridview attribute header if value ois encrypted
- setOptions() : mixed
- Gets the "values" from the group that inherits to this group and ... ... sets the variables (not DB attributes) of "oOptions", "oOptionLabels", "aOptions" and "showInherited" (most of them used for frontend i think)
- setToDefault() : mixed
- setToInherit() : mixed
- tableName() : string
- updateAll() : int
- Updates records with the specified condition.
- 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
- translateOptionLabels() : string
- shouldInherit() : bool
- Returns true if the attribute should be inherited according to it's value.
Properties
$active
public
mixed
$active
$additional_languages
public
mixed
$additional_languages
$admin
public
string
$admin
$adminemail
public
string
$adminemail
$alloweditaftercompletion
public
string
$alloweditaftercompletion
$allowprev
public
string
$allowprev
$allowregister
public
string
$allowregister
$allowsave
public
string
$allowsave
$anonymized
public
string
$anonymized
$aOptions
public
mixed
$aOptions
= array()
$assessments
public
string
$assessments
$attributedescriptions
public
string
$attributedescriptions
$autonumber_start
public
int
$autonumber_start
$autoredirect
public
string
$autoredirect
$bEncryption
public
mixed
$bEncryption
= \false
$bounce_email
public
string
$bounce_email
$datecreated
public
string
$datecreated
$datestamp
public
string
$datestamp
$emailnotificationto
public
string
$emailnotificationto
$emailresponseto
public
string
$emailresponseto
$expires
public
string
$expires
$format
public
string
$format
$gsid
public
int
$gsid
$htmlemail
public
string
$htmlemail
$ipaddr
public
string
$ipaddr
$ipanonymize
public
string
$ipanonymize
$listpublic
public
string
$listpublic
$navigationdelay
public
int
$navigationdelay
$nokeyboard
public
string
$nokeyboard
$oOptionLabels
public
mixed
$oOptionLabels
$oOptions
public
mixed
$oOptions
$owner_id
public
int
$owner_id
$printanswers
public
string
$printanswers
$publicgraphs
public
string
$publicgraphs
$publicstatistics
public
string
$publicstatistics
$questionindex
public
int
$questionindex
$refurl
public
string
$refurl
$savetimings
public
string
$savetimings
$sendconfirmation
public
string
$sendconfirmation
$showgroupinfo
public
string
$showgroupinfo
$showInherited
public
mixed
$showInherited
= 1
$shownoanswer
public
string
$shownoanswer
$showprogress
public
string
$showprogress
$showqnumcode
public
string
$showqnumcode
$showsurveypolicynotice
public
int
$showsurveypolicynotice
$showwelcome
public
string
$showwelcome
$showxquestions
public
string
$showxquestions
$startdate
public
string
$startdate
$template
public
string
$template
$tokenanswerspersistence
public
string
$tokenanswerspersistence
$tokenlength
public
int
$tokenlength
$usecaptcha
public
string
$usecaptcha
$usecookie
public
string
$usecookie
$optionAttributes
protected
mixed
$optionAttributes
= array()
$optionAttributesChar
protected
mixed
$optionAttributesChar
= array('anonymized', 'savetimings', 'datestamp', 'usecookie', 'allowregister', 'allowsave', 'autoredirect', 'allowprev', 'printanswers', 'ipaddr', 'ipanonymize', 'refurl', 'publicstatistics', 'publicgraphs', 'listpublic', 'htmlemail', 'sendconfirmation', 'tokenanswerspersistence', 'assessments', 'showxquestions', 'showgroupinfo', 'shownoanswer', 'showqnumcode', 'showwelcome', 'showprogress', 'nokeyboard', 'alloweditaftercompletion')
$optionAttributesInteger
protected
mixed
$optionAttributesInteger
= array('owner_id', 'tokenlength', 'questionindex', 'navigationdelay')
$optionAttributesText
protected
mixed
$optionAttributesText
= array('admin', 'adminemail', 'template', 'bounce_email', 'emailresponseto', 'emailnotificationto')
$xssFilterAttributes
protected
array<string|int, string>
$xssFilterAttributes
= []
Array of attributes that should be XSS filtered on mass updates
$aSurveysGroupSettings
private
static mixed
$aSurveysGroupSettings
= []
Methods
attributeLabels()
public
attributeLabels() : array<string|int, mixed>
Return values
array<string|int, mixed> —customized attribute labels (name=>label)
behaviors()
Lists the behaviors of this model
public
behaviors() : array<string|int, mixed>
Below is a list of all behaviors we register:
Tags
Return values
array<string|int, 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
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
Return values
int —number of rows affected by the execution.
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
PluginEventencrypt()
Encrypt values
public
encrypt() : mixed
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
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>
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.
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.
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.
getInstance()
Recursive function
public
static getInstance([int $iSurveyGroupId = 0 ][, Survey|null $oSurvey = null ][, self|null $instance = null ][, int $iStep = 1 ][, bool $bRealValues = false ]) : SurveysGroupsettings
Gets the real values for a group. A group could inherit from a group, this one could inherit from a group ... It steps up (see param $iStep) until it has found the real settings ...
Parameters
- $iSurveyGroupId : int = 0
- $oSurvey : Survey|null = null
- $instance : self|null = null
- $iStep : int = 1
-
this is inheritance step (recursive step) (parent, parentParent, parentParentParent ?)
- $bRealValues : bool = false
Return values
SurveysGroupsettings —instance
getIsActive()
public
getIsActive() : bool
Return values
boolgetIsAnonymized()
public
getIsAnonymized() : bool
Return values
boolgetMaxId()
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
Return values
false|intgetMinId()
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
Return values
false|intmodel()
Returns the static model of the specified AR class.
public
static model([string $className = __CLASS__ ]) : SurveysGroupsettings
Please note that you should have this exact method in all your CActiveRecord descendants!
Parameters
- $className : string = __CLASS__
-
active record class name.
Return values
SurveysGroupsettings —the static model class
relations()
public
relations() : array<string|int, mixed>
Return values
array<string|int, mixed> —relational rules.
rules()
public
rules() : array<string|int, mixed>
Return values
array<string|int, mixed> —validation rules for model attributes.
save()
public
save([mixed $runValidation = true ][, mixed $attributes = null ]) : mixed
Parameters
- $runValidation : mixed = true
- $attributes : mixed = null
Tags
search()
Retrieves a list of models based on the current search/filter conditions.
public
search() : CActiveDataProvider
Typical usecase:
- Initialize the model fields with values from filter form.
- Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields.
- Pass data provider to CGridView, CListView or any similar widget.
Return values
CActiveDataProvider —the data provider that can return the models based on the search/filter conditions.
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
Return values
stringsetOptions()
Gets the "values" from the group that inherits to this group and ... ... sets the variables (not DB attributes) of "oOptions", "oOptionLabels", "aOptions" and "showInherited" (most of them used for frontend i think)
public
setOptions() : mixed
setToDefault()
public
setToDefault() : mixed
setToInherit()
public
setToInherit() : mixed
tableName()
public
tableName() : string
Return values
string —the associated database table name
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
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
Return values
mixed —the AR objects populated with the query result
translateOptionLabels()
protected
static translateOptionLabels(mixed $instance, mixed $attribute, mixed $value) : string
Parameters
- $instance : mixed
- $attribute : mixed
- $value : mixed
Return values
stringshouldInherit()
Returns true if the attribute should be inherited according to it's value.
private
shouldInherit(string $attribute) : bool
Parameters
- $attribute : string