Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
CanUploadResult.php
1<?php
2
4
5class CanUploadResult extends \Bitrix\Main\Result implements \JsonSerializable
6{
7 public function __construct()
8 {
9 parent::__construct();
10 }
11
12 public static function reject(): self
13 {
14 $canUploadResult = new self();
15 $canUploadResult->addError(new UploaderError(UploaderError::FILE_UPLOAD_ACCESS_DENIED));
16
17 return $canUploadResult;
18 }
19
20 public function jsonSerialize(): array
21 {
22 return [
23 'errors' => $this->getErrors(),
24 'success' => $this->isSuccess(),
25 ];
26 }
27}