Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/ui/lib/FileUploader/ |
Upload File : |
<?php namespace Bitrix\UI\FileUploader; class PendingFileCollection implements \IteratorAggregate { /** * @var array<string, PendingFile> */ private array $files = []; public function add(PendingFile $pendingFile): void { $this->files[$pendingFile->getId()] = $pendingFile; } public function get(string $tempFileId): ?PendingFile { return $this->files[$tempFileId] ?? null; } public function getByFileId(int $fileId): ?PendingFile { foreach ($this->files as $file) { if ($file->getFileId() === $fileId) { return $file; } } return null; } /** * @return int[] */ public function getFileIds(): array { $ids = []; foreach ($this->files as $file) { $id = $file->getFileId(); if ($id !== null) { $ids[] = $id; } } return $ids; } public function makePersistent(): void { foreach ($this->files as $file) { $file->makePersistent(); } } public function remove(): void { foreach ($this->files as $file) { $file->remove(); } } /** * @return array<string, PendingFile> */ public function getAll(): array { return $this->files; } /** * @return \ArrayIterator|array<string, PendingFile> */ public function getIterator(): \ArrayIterator { return new \ArrayIterator($this->files); } }