Landing extends CopyImplementer
Class copies landings.
if you want copy in another site then set $targetSiteId. To put landing in folders, set the map ids of old and new folders.
Table of Contents
Methods
- __construct() : mixed
- add() : int|bool
- Adds landing.
- copyChildren() : Result
- Starts copying children entities.
- getErrors() : array<string|int, Error>
- getFields() : array<string|int, mixed>
- Returns landing fields.
- prepareFieldsToCopy() : array<string|int, mixed>
- Preparing data before creating a new landing.
- setExecutiveUserId() : void
- To copy on agent need user id.
- setTargetSiteId() : void
- Set $targetSiteId if you want copy in another site.
- 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 landing.
public
add(Container $container, array<string|int, mixed> $fields) : int|bool
Parameters
- $container : Container
-
Container with data that is needed in the process of copying the entity.
- $fields : array<string|int, mixed>
-
The landing fields.
Return values
int|bool —return landing id or false.
copyChildren()
Starts copying children entities.
public
copyChildren(Container $container, int $landingId, int $copiedLandingId) : Result
Parameters
- $container : Container
- $landingId : int
-
Landing id.
- $copiedLandingId : int
-
Copied landing id.
Return values
ResultgetErrors()
public
getErrors() : array<string|int, Error>
Return values
array<string|int, Error>getFields()
Returns landing fields.
public
getFields(Container $container, int $landingId) : array<string|int, mixed>
Parameters
- $container : Container
-
Container with data that is needed in the process of copying the entity.
- $landingId : int
-
Landing id.
Return values
array<string|int, mixed> —$fields
prepareFieldsToCopy()
Preparing data before creating a new landing.
public
prepareFieldsToCopy(Container $container, array<string|int, mixed> $fields) : array<string|int, mixed>
Parameters
- $container : Container
-
Container with data that is needed in the process of copying the entity.
- $fields : array<string|int, mixed>
-
List landing fields.
Return values
array<string|int, mixed> —$fields
setExecutiveUserId()
To copy on agent need user id.
public
setExecutiveUserId(int $executiveUserId) : void
Parameters
- $executiveUserId : int
setTargetSiteId()
Set $targetSiteId if you want copy in another site.
public
setTargetSiteId(int $targetSiteId) : void
Parameters
- $targetSiteId : int
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.