1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
manualuploadregistry.php
См. документацию.
1<?php
2
4
6
8{
9 private static ?self $instance = null;
10
11 private array $storage = [];
12
13 public static function getInstance(): self
14 {
15 self::$instance ??= new self();
16
17 return self::$instance;
18 }
19
20 public function isFileRegistered(array $userField, int $fileId): bool
21 {
22 $key = $this->getUserFieldStorageKey($userField);
23 if (!$key)
24 {
25 return false;
26 }
27
28 return isset($this->storage[$key][$fileId]);
29 }
30
31 public function registerFile(array $userField, int $fileId): void
32 {
33 $key = $this->getUserFieldStorageKey($userField);
34 if (!$key)
35 {
36 return;
37 }
38
39 $this->storage[$key] ??= [];
40 $this->storage[$key][$fileId] = $fileId;
41 }
42
43 private function getUserFieldStorageKey(array $userField): ?string
44 {
45 if (!$this->isUserField($userField))
46 {
47 return null;
48 }
49
50 return FileInputUtility::instance()->getUserFieldCid($userField);
51 }
52
53 private function isUserField(array $userFieldCandidate): bool
54 {
55 return isset($userFieldCandidate['ID'], $userFieldCandidate['ENTITY_ID'], $userFieldCandidate['FIELD_NAME']);
56 }
57}
registerFile(array $userField, int $fileId)
Определения manualuploadregistry.php:31
isFileRegistered(array $userField, int $fileId)
Определения manualuploadregistry.php:20
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(empty($signedUserToken)) $key
Определения quickway.php:257