1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
copyimplementer.php
См. документацию.
1<?php
2namespace Bitrix\Main\Copy;
3
4use Bitrix\Main\Result;
5
10abstract class CopyImplementer
11{
15 protected $result;
16
21 protected $ufIgnoreList = [];
23
24 public function __construct()
25 {
26 $this->result = new Result();
27 }
28
32 public function getErrors()
33 {
34 return $this->result->getErrors();
35 }
36
42 public function setUserFieldManager(\CUserTypeManager $userTypeManager)
43 {
44 $this->userTypeManager = $userTypeManager;
45 }
46
52 public function setUfIgnoreList(array $ufIgnoreList): void
53 {
54 $this->ufIgnoreList = $ufIgnoreList;
55 }
56
62 public function setExecutiveUserId(int $executiveUserId): void
63 {
64 $this->executiveUserId = $executiveUserId;
65 }
66
67 protected function copyUfFields(int $entityId, int $copiedEntityId, string $ufObject)
68 {
69 if (!$this->userTypeManager)
70 {
71 return;
72 }
73
74 $this->userTypeManager->copy($ufObject, $entityId, $copiedEntityId,
75 $this, $this->executiveUserId, $this->ufIgnoreList);
76 }
77
85 abstract public function add(Container $container, array $fields);
86
94 abstract public function getFields(Container $container, $entityId);
95
103 abstract public function prepareFieldsToCopy(Container $container, array $fields);
104
113 abstract public function copyChildren(Container $container, $entityId, $copiedEntityId);
114
119 protected function getResult(array $results = [])
120 {
121 $copyResult = new Result();
122
123 $data = [];
124 foreach ($results as $result)
125 {
126 $data = $data + $result->getData();
127 if ($result->getErrors())
128 {
129 $copyResult->addErrors($result->getErrors());
130 }
131 }
132
133 if ($data)
134 {
135 $copyResult->setData($data);
136 }
137
138 return $copyResult;
139 }
140}
setUfIgnoreList(array $ufIgnoreList)
Определения copyimplementer.php:52
setUserFieldManager(\CUserTypeManager $userTypeManager)
Определения copyimplementer.php:42
setExecutiveUserId(int $executiveUserId)
Определения copyimplementer.php:62
getFields(Container $container, $entityId)
add(Container $container, array $fields)
copyUfFields(int $entityId, int $copiedEntityId, string $ufObject)
Определения copyimplementer.php:67
getResult(array $results=[])
Определения copyimplementer.php:119
copyChildren(Container $container, $entityId, $copiedEntityId)
prepareFieldsToCopy(Container $container, array $fields)
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$entityId
Определения payment.php:4
$fields
Определения yandex_run.php:501