Question extends CopyImplementer
Interface CopyImplementer for copy entities.
Table of Contents
Methods
- __construct() : mixed
- add() : int|bool
- Adds question.
- copyChildren() : Result
- Starts copying children entities.
- getErrors() : array<string|int, Error>
- getFields() : array<string|int, mixed>
- Returns question fields.
- prepareFieldsToCopy() : array<string|int, mixed>
- Preparing data before creating a new entity.
- setAnswerCopier() : void
- To copy questions needs question copier.
- setExecutiveUserId() : void
- To copy on agent need user id.
- setResetVotingResult() : void
- setUfIgnoreList() : void
- To avoid copying specific fields, specify a list of fields to ignore.
- setUserFieldManager() : mixed
- To copy uf fields, you must pass the uf field manager.
Methods
__construct()
public
__construct() : mixed
add()
Adds question.
public
add(Container $container, array<string|int, mixed> $fields) : int|bool
Parameters
- $container : Container
- $fields : array<string|int, mixed>
Tags
Return values
int|bool —return entity id or false.
copyChildren()
Starts copying children entities.
public
copyChildren(Container $container, int $entityId, int $copiedEntityId) : Result
Parameters
- $container : Container
- $entityId : int
-
Entity id.
- $copiedEntityId : int
-
Copied entity id.
Return values
ResultgetErrors()
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getFields()
Returns question fields.
public
getFields(Container $container, int $entityId) : array<string|int, mixed>
Parameters
- $container : Container
- $entityId : int
Tags
Return values
array<string|int, mixed> —$fields
prepareFieldsToCopy()
Preparing data before creating a new entity.
public
prepareFieldsToCopy(Container $container, array<string|int, mixed> $fields) : array<string|int, mixed>
Parameters
- $container : Container
- $fields : array<string|int, mixed>
-
List entity fields.
Return values
array<string|int, mixed> —$fields
setAnswerCopier()
To copy questions needs question copier.
public
setAnswerCopier(EntityCopier $answerCopier) : void
Parameters
- $answerCopier : EntityCopier
setExecutiveUserId()
To copy on agent need user id.
public
setExecutiveUserId(int $executiveUserId) : void
Parameters
- $executiveUserId : int
setResetVotingResult()
public
setResetVotingResult(bool $bool) : void
Parameters
- $bool : bool
setUfIgnoreList()
To avoid copying specific fields, specify a list of fields to ignore.
public
setUfIgnoreList(array<string|int, mixed> $ufIgnoreList) : void
Parameters
- $ufIgnoreList : array<string|int, mixed>
-
Ignore list.
setUserFieldManager()
To copy uf fields, you must pass the uf field manager.
public
setUserFieldManager(CUserTypeManager $userTypeManager) : mixed
Parameters
- $userTypeManager : CUserTypeManager
-
Uf fields.