Bitrix API

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
throws
SystemException
Return values
bool

canParticipate()

Checks rights for voting.

public canParticipate(int $userId) : bool
Parameters
$userId : int

Id of user.

Return values
bool

canRead()

Checks rights to read current attached object.

public canRead(int $userId) : bool
Parameters
$userId : int

Id of user.

Tags
throws
SystemException
Return values
bool

canReadResult()

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
throws
AccessDeniedException

delete()

Deletes attach and vote in some cases.

public delete() : mixed
Tags
@return

boolean;

exportExcel()

Exports data of voting into excel file

public exportExcel() : void
Tags
throws
InvalidOperationException

fillStatistic()

public fillStatistic() : void

generateUid()

public static generateUid() : string
Return values
string

getAttachId()

Returns attachment id.

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

getConnector()

Returns connector instance for attached object.

public getConnector() : Connector|null
Tags
throws
LoaderException
throws
SystemException
Return values
Connector|null

getData()

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>|null

getDataByEntity()

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
string

getEntityType()

Returns entity type.

public getEntityType() : string
Return values
string

getErrorByCode()

public getErrorByCode(string|int $code) : Error|null
Parameters
$code : string|int

The code of the error.

Tags
inheritdoc

Returns an error with the necessary code.

Return values
Error|null

getModuleId()

Returns module id.

public getModuleId() : string
Return values
string

getUserEventAnswers()

public getUserEventAnswers(int $eventId) : UserBallot
Parameters
$eventId : int
Return values
UserBallot

getUserEventsAnswersStatByUserId()

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|null

init()

exists only for child class

public init() : void
Tags
throws
ArgumentException
throws
ArgumentNullException
throws
ObjectNotFoundException

isFinished()

public isFinished() : bool
Return values
bool

isPublicVote()

public isPublicVote() : bool
Return values
bool

isVotedFor()

Checks if current user voted for this vote.

public isVotedFor(int $userId) : bool|int
Parameters
$userId : int

User ID.

Return values
bool|int

loadFromId()

public static loadFromId(int $id[, bool $shouldBeNewIfIdIsNull = false ]) : BaseObject
Parameters
$id : int

Entity ID.

$shouldBeNewIfIdIsNull : bool = false
Return values
BaseObject

loadUserGroups()

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
bool

offsetGet()

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|null

offsetSet()

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
throws
NotSupportedException

offsetUnset()

Is not supported.

public offsetUnset(string $offset) : void
Parameters
$offset : string

Key for vote or attach data array.

Tags
throws
NotSupportedException

recall()

public recall(int $userId[, string $actionUuid = '' ]) : Result
Parameters
$userId : int
$actionUuid : string = ''
Return values
Result

resume()

Prolongs voting period.

public resume([string $actionUuid = '' ]) : void
Parameters
$actionUuid : string = ''

Frontend uid to send in push

Tags
throws
InvalidOperationException

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
bool

setStorage()

public setStorage(int $id) : mixed
Parameters
$id : int
Tags
throws
ArgumentNullException

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
throws
InvalidOperationException

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

Tags
throws
InvalidOperationException
Return values
bool

        
On this page

Search results