Attach extends BaseObject implements ArrayAccess
Table of Contents
Interfaces
- ArrayAccess
Constants
- UID_LENGTH = 16
Properties
- $storage : mixed
Methods
- __construct() : mixed
- canEdit() : bool
- Checks rights to update current attached object.
- canParticipate() : bool
- Checks rights for voting.
- canRead() : bool
- Checks rights to read current attached object.
- canReadResult() : mixed
- canRevote() : mixed
- canVote() : mixed
- checkData() : void
- Checks array for correct data/
- delete() : mixed
- Deletes attach and vote in some cases.
- exportExcel() : void
- Exports data of voting into excel file
- fillStatistic() : void
- generateUid() : string
- getApplication() : CMain
- getAttachId() : int|null
- Returns attachment id.
- getConnector() : Connector|null
- Returns connector instance for attached object.
- getData() : array<string|int, mixed>|null
- Return array where first key is attach array, second - vote array
- getDataByEntity() : mixed
- Returns array of attaches linked to special entity
- getEntityId() : string
- Returns entity id.
- getEntityType() : string
- Returns entity type.
- getErrorByCode() : Error|null
- getErrors() : array<string|int, Error>
- getId() : int
- getModuleId() : string
- Returns module id.
- getStorage() : Channel
- getUser() : CUser
- getUserEventAnswers() : UserBallot
- getUserEventsAnswersStatByUserId() : array<string|int, mixed>
- getVoteId() : int|null
- Returns vote id.
- init() : void
- exists only for child class
- isFinished() : bool
- isPublicVote() : bool
- isVotedFor() : bool|int
- Checks if current user voted for this vote.
- loadFromId() : BaseObject
- loadUserGroups() : array<string|int, mixed>
- offsetExists() : bool
- offsetGet() : array<string|int, mixed>|mixed|null
- offsetSet() : void
- Is not supported.
- offsetUnset() : void
- Is not supported.
- recall() : Result
- resume() : void
- Prolongs voting period.
- save() : bool
- Update vote data.
- setStorage() : mixed
- setVote() : mixed
- shutdown() : mixed
- Debug function
- stop() : void
- Finishes voting period
- voteFor() : bool
- Voting for vote from current user $USER.
Constants
UID_LENGTH
public
mixed
UID_LENGTH
= 16
Properties
$storage
public
static mixed
$storage
= array()
Methods
__construct()
public
__construct(mixed $id) : mixed
Parameters
- $id : mixed
canEdit()
Checks rights to update current attached object.
public
canEdit(int $userId) : bool
Parameters
- $userId : int
-
Id of user.
Tags
Return values
boolcanParticipate()
Checks rights for voting.
public
canParticipate(int $userId) : bool
Parameters
- $userId : int
-
Id of user.
Return values
boolcanRead()
Checks rights to read current attached object.
public
canRead(int $userId) : bool
Parameters
- $userId : int
-
Id of user.
Tags
Return values
boolcanReadResult()
public
canReadResult(mixed $userId) : mixed
Parameters
- $userId : mixed
canRevote()
public
canRevote(mixed $userId) : mixed
Parameters
- $userId : mixed
canVote()
public
canVote(mixed $userId) : mixed
Parameters
- $userId : mixed
checkData()
Checks array for correct data/
public
checkData(array<string|int, mixed> &$data) : void
Parameters
- $data : array<string|int, mixed>
-
Array( "TITLE" => "ABC...", "QUESTIONS" => array( 1 => array( "ID" => 0, "QUESTION" => "Question text", "QUESTION_TYPE" => "text"||"html", "ANSWERS" => array( array( "ID" => 0, "MESSAGE" => "Answer text", "MESSAGE_TYPE" => "text"||"html", "FIELD_TYPE" => 0||1||2||3||4|| ) ) );.
Tags
delete()
Deletes attach and vote in some cases.
public
delete() : mixed
Tags
exportExcel()
Exports data of voting into excel file
public
exportExcel() : void
Tags
fillStatistic()
public
fillStatistic() : void
generateUid()
public
static generateUid() : string
Return values
stringgetApplication()
public
getApplication() : CMain
Return values
CMaingetAttachId()
Returns attachment id.
public
getAttachId() : int|null
Return values
int|nullgetConnector()
Returns connector instance for attached object.
public
getConnector() : Connector|null
Tags
Return values
Connector|nullgetData()
Return array where first key is attach array, second - vote array
public
static getData(int $id) : array<string|int, mixed>|null
Parameters
- $id : int
-
Attach ID.
Return values
array<string|int, mixed>|nullgetDataByEntity()
Returns array of attaches linked to special entity
public
static getDataByEntity(array<string|int, mixed> $id) : mixed
Parameters
- $id : array<string|int, mixed>
-
Array("ENTITY_TYPE" => "blog", "ENTITY_ID" => 89);.
getEntityId()
Returns entity id.
public
getEntityId() : string
Return values
stringgetEntityType()
Returns entity type.
public
getEntityType() : string
Return values
stringgetErrorByCode()
public
getErrorByCode(string|int $code) : Error|null
Parameters
- $code : string|int
-
The code of the error.
Tags
Return values
Error|nullgetErrors()
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getId()
public
getId() : int
Return values
intgetModuleId()
Returns module id.
public
getModuleId() : string
Return values
stringgetStorage()
public
getStorage() : Channel
Return values
ChannelgetUser()
public
getUser() : CUser
Return values
CUsergetUserEventAnswers()
public
getUserEventAnswers(int $eventId) : UserBallot
Parameters
- $eventId : int
Return values
UserBallotgetUserEventsAnswersStatByUserId()
public
getUserEventsAnswersStatByUserId(int $userId) : array<string|int, mixed>
Parameters
- $userId : int
Return values
array<string|int, mixed>getVoteId()
Returns vote id.
public
getVoteId() : int|null
Return values
int|nullinit()
exists only for child class
public
init() : void
Tags
isFinished()
public
isFinished() : bool
Return values
boolisPublicVote()
public
isPublicVote() : bool
Return values
boolisVotedFor()
Checks if current user voted for this vote.
public
isVotedFor(int $userId) : bool|int
Parameters
- $userId : int
-
User ID.
Return values
bool|intloadFromId()
public
static loadFromId(int $id[, bool $shouldBeNewIfIdIsNull = false ]) : BaseObject
Parameters
- $id : int
-
Entity ID.
- $shouldBeNewIfIdIsNull : bool = false
Return values
BaseObjectloadUserGroups()
public
static loadUserGroups(int $userId) : array<string|int, mixed>
Parameters
- $userId : int
-
User ID.
Return values
array<string|int, mixed>offsetExists()
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
-
Key for vote or attach data array.
Return values
booloffsetGet()
public
offsetGet(string $offset) : array<string|int, mixed>|mixed|null
Parameters
- $offset : string
-
Key for vote or attach data array.
Return values
array<string|int, mixed>|mixed|nulloffsetSet()
Is not supported.
public
offsetSet(string $offset, mixed $value) : void
Parameters
- $offset : string
-
Key for vote or attach data array.
- $value : mixed
-
Value for vote or attach data array.
Tags
offsetUnset()
Is not supported.
public
offsetUnset(string $offset) : void
Parameters
- $offset : string
-
Key for vote or attach data array.
Tags
recall()
public
recall(int $userId[, string $actionUuid = '' ]) : Result
Parameters
- $userId : int
- $actionUuid : string = ''
Return values
Resultresume()
Prolongs voting period.
public
resume([string $actionUuid = '' ]) : void
Parameters
- $actionUuid : string = ''
-
Frontend uid to send in push
Tags
save()
Update vote data.
public
save(array<string|int, mixed> $data[, int $createdBy = 0 ]) : bool
Parameters
- $data : array<string|int, mixed>
-
Array( "TITLE" => "ABC...", "QUESTIONS" => array( 1 => array( "ID" => 0, "QUESTION" => "Question text", "QUESTION_TYPE" => "text"||"html", "ANSWERS" => array( array( "ID" => 0, "MESSAGE" => "Answer text", "MESSAGE_TYPE" => "text"||"html", "FIELD_TYPE" => 0||1||2||3||4|| ) ) );.
- $createdBy : int = 0
-
User ID.
Return values
boolsetStorage()
public
setStorage(int $id) : mixed
Parameters
- $id : int
Tags
setVote()
public
setVote(int|Vote $vote) : mixed
Parameters
- $vote : int|Vote
shutdown()
Debug function
public
static shutdown() : mixed
stop()
Finishes voting period
public
stop([string $actionUuid = '' ]) : void
Parameters
- $actionUuid : string = ''
-
Frontend uid to send in push .
Tags
voteFor()
Voting for vote from current user $USER.
public
voteFor(array<string|int, mixed> $request[, string $actionUuid = '' ]) : bool
Parameters
- $request : array<string|int, mixed>
-
Array(" vote_checkbox_".$questionId => array(1,2,3,...), "vote_multiselect_".$questionId => array(1,2,3,...), "vote_dropdown_".$questionId => 12 || "12", "vote_radio_".$questionId => 12 || "12", "vote_field_".$answerId => "12").
- $actionUuid : string = ''
-
Frontend uid to send in push