Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
LoadResult.php
1<?php
2
4
5class LoadResult extends \Bitrix\Main\Result implements \JsonSerializable
6{
8 protected $id;
9 protected ?FileInfo $file = null;
10
11 public function __construct($id)
12 {
13 $this->id = $id;
14
15 parent::__construct();
16 }
17
18 public function getId()
19 {
20 return $this->id;
21 }
22
23 public function getFile(): ?FileInfo
24 {
25 return $this->file;
26 }
27
28 public function setFile(FileInfo $file): void
29 {
30 $this->file = $file;
31 }
32
33 public function jsonSerialize(): array
34 {
35 return [
36 'id' => $this->getId(),
37 'errors' => $this->getErrors(),
38 'success' => $this->isSuccess(),
39 'data' => [
40 'file' => $this->getFile(),
41 ],
42 ];
43 }
44}