Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
IBlockElementToUpdate.php
1<?php
2
4
6{
7 private int $modifiedBy = 0;
8 private int $elementId = 0;
9 private int $iBlockId = 0;
10 private int $sectionId = 0;
11 private array $values;
12
13 private bool $isCheckPermissionsEnabled = true;
14
15 public function __construct(
16 int $modifiedBy,
17 int $elementId,
18 int $iBlockId,
19 int $sectionId,
20 array $values,
21 )
22 {
23 if ($elementId > 0)
24 {
25 $this->elementId = $elementId;
26 }
27 if ($iBlockId > 0)
28 {
29 $this->iBlockId = $iBlockId;
30 }
31 if ($sectionId > 0)
32 {
33 $this->sectionId = $sectionId;
34 }
35 if ($modifiedBy > 0)
36 {
37 $this->modifiedBy = $modifiedBy;
38 }
39
40 $this->values = $values;
41 }
42
43 public function enableCheckPermissions(): static
44 {
45 $this->isCheckPermissionsEnabled = true;
46
47 return $this;
48 }
49
50 public function disableCheckPermissions(): static
51 {
52 $this->isCheckPermissionsEnabled = false;
53
54 return $this;
55 }
56
57 public function isCheckPermissionsEnabled(): bool
58 {
59 return $this->isCheckPermissionsEnabled;
60 }
61
62 public function getElementId(): int
63 {
64 return $this->elementId;
65 }
66
67 public function getSectionId(): int
68 {
69 return $this->sectionId;
70 }
71
72 public function getIBlockId(): int
73 {
74 return $this->iBlockId;
75 }
76
77 public function getFieldValueById(string $fieldsId)
78 {
79 return $this->values[$fieldsId] ?? null;
80 }
81
82 public function getModifiedBy(): int
83 {
84 return $this->modifiedBy;
85 }
86}
__construct(int $modifiedBy, int $elementId, int $iBlockId, int $sectionId, array $values,)