SurveyAccessModeService
in package
Table of Contents
Properties
- $ACCESS_TYPE_CLOSED : mixed
- $ACCESS_TYPE_OPEN : mixed
- $ACTION_ARCHIVE : mixed
- $ACTION_DROP : mixed
- $ACTION_KEEP : mixed
- $TOKEN_TABLE_ARCHIVED : mixed
- $TOKEN_TABLE_CREATED : mixed
- $TOKEN_TABLE_DROPPED : mixed
- $TOKEN_TABLE_NO_ACTION : mixed
- $app : LSYii_Application
- $permission : Permission
- $supportedAccessModes : mixed
- $supportedActions : mixed
- $survey : Survey
- $test : bool
- $tokenTableAction : string
Methods
- __construct() : mixed
- changeAccessMode() : bool
- Changes the access mode of the survey
- getTokenTableAction() : string
- Returns the latest token table action
- hasPermission() : bool
- Checks whether the issuer has the necessary permissions for the action
- newParticipantTable() : bool
- Creates a token table for the survey if it does not already exist
- dropTokenTable() : void
- Drops token table if it exists
Properties
$ACCESS_TYPE_CLOSED
public
static mixed
$ACCESS_TYPE_CLOSED
= 'C'
$ACCESS_TYPE_OPEN
public
static mixed
$ACCESS_TYPE_OPEN
= 'O'
$ACTION_ARCHIVE
public
static mixed
$ACTION_ARCHIVE
= 'A'
$ACTION_DROP
public
static mixed
$ACTION_DROP
= 'D'
$ACTION_KEEP
public
static mixed
$ACTION_KEEP
= 'K'
$TOKEN_TABLE_ARCHIVED
public
static mixed
$TOKEN_TABLE_ARCHIVED
= 'ARCHIVED'
$TOKEN_TABLE_CREATED
public
static mixed
$TOKEN_TABLE_CREATED
= 'CREATED'
$TOKEN_TABLE_DROPPED
public
static mixed
$TOKEN_TABLE_DROPPED
= 'DROPPED'
$TOKEN_TABLE_NO_ACTION
public
static mixed
$TOKEN_TABLE_NO_ACTION
= 'NO ACTION'
$app
protected
LSYii_Application
$app
$permission
protected
Permission
$permission
$supportedAccessModes
protected
static mixed
$supportedAccessModes
= null
$supportedActions
protected
static mixed
$supportedActions
= null
$survey
protected
Survey
$survey
$test
protected
bool
$test
$tokenTableAction
protected
string
$tokenTableAction
Methods
__construct()
public
__construct(Permission $permission, Survey $survey, LSYii_Application $app[, bool $test = false ]) : mixed
Parameters
- $permission : Permission
- $survey : Survey
- $app : LSYii_Application
- $test : bool = false
changeAccessMode()
Changes the access mode of the survey
public
changeAccessMode(int $surveyID, string $accessMode[, string $action = 'K' ]) : bool
Parameters
- $surveyID : int
-
the id of the survey whose access mode is to be changed
- $accessMode : string
-
the access mode we desire to have
- $action : string = 'K'
-
whether we intend to archive the tokens table or not
Tags
Return values
bool —whether the change was done
getTokenTableAction()
Returns the latest token table action
public
getTokenTableAction() : string
Return values
stringhasPermission()
Checks whether the issuer has the necessary permissions for the action
public
hasPermission(int $surveyID, string $newMode) : bool
Parameters
- $surveyID : int
-
the id of the survey
- $newMode : string
-
the access mode we intend to set
Return values
bool —whether all the permissions necessary are present
newParticipantTable()
Creates a token table for the survey if it does not already exist
public
newParticipantTable(Survey $survey[, bool $forced = false ]) : bool
Parameters
- $survey : Survey
- $forced : bool = false
Return values
booldropTokenTable()
Drops token table if it exists
protected
dropTokenTable(Survey $survey[, string $action = 'K' ]) : void
Parameters
- $survey : Survey
-
the survey whose participant list is to be dropped
- $action : string = 'K'
-
whether we archive the tokens, or remove them