Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
PendingFileCollection.php
1
<?php
2
3
namespace
Bitrix\UI\FileUploader
;
4
5
class
PendingFileCollection
implements
\IteratorAggregate
6
{
10
private
array $files = [];
11
12
public
function
add
(
PendingFile
$pendingFile): void
13
{
14
$this->files[$pendingFile->
getId
()] = $pendingFile;
15
}
16
17
public
function
get
(
string
$tempFileId): ?
PendingFile
18
{
19
return
$this->files[$tempFileId] ??
null
;
20
}
21
22
public
function
getByFileId
(
int
$fileId): ?
PendingFile
23
{
24
foreach
($this->files as $file)
25
{
26
if
($file->getFileId() === $fileId)
27
{
28
return
$file;
29
}
30
}
31
32
return
null
;
33
}
34
38
public
function
getFileIds
(): array
39
{
40
$ids = [];
41
foreach
($this->files as $file)
42
{
43
$id = $file->getFileId();
44
if
($id !==
null
)
45
{
46
$ids[] = $id;
47
}
48
}
49
50
return
$ids;
51
}
52
53
public
function
makePersistent
(): void
54
{
55
foreach
($this->files as $file)
56
{
57
$file->makePersistent();
58
}
59
}
60
61
public
function
remove
(): void
62
{
63
foreach
($this->files as $file)
64
{
65
$file->remove();
66
}
67
}
68
72
public
function
getAll
(): array
73
{
74
return
$this->files;
75
}
76
80
public
function
getIterator
(): \ArrayIterator
81
{
82
return
new \ArrayIterator($this->files);
83
}
84
}
Bitrix\UI\FileUploader\PendingFileCollection
Definition
PendingFileCollection.php:6
Bitrix\UI\FileUploader\PendingFileCollection\makePersistent
makePersistent()
Definition
PendingFileCollection.php:53
Bitrix\UI\FileUploader\PendingFileCollection\getIterator
getIterator()
Definition
PendingFileCollection.php:80
Bitrix\UI\FileUploader\PendingFileCollection\getByFileId
getByFileId(int $fileId)
Definition
PendingFileCollection.php:22
Bitrix\UI\FileUploader\PendingFileCollection\getFileIds
getFileIds()
Definition
PendingFileCollection.php:38
Bitrix\UI\FileUploader\PendingFileCollection\getAll
getAll()
Definition
PendingFileCollection.php:72
Bitrix\UI\FileUploader\PendingFileCollection\add
add(PendingFile $pendingFile)
Definition
PendingFileCollection.php:12
Bitrix\UI\FileUploader\PendingFile
Definition
PendingFile.php:9
Bitrix\UI\FileUploader\PendingFile\getId
getId()
Definition
PendingFile.php:21
Bitrix\UI\FileUploader
Definition
CanUploadResult.php:3
modules
ui
lib
FileUploader
PendingFileCollection.php
Создано системой
1.10.0