1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Result.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2;
4
9{
10 protected bool $hasResult = false;
11
17 public function setResult($result): self
18 {
19 $this->hasResult = true;
20 return parent::setData(['RESULT' => $result]);
21 }
22
27 public function getResult()
28 {
29 return parent::getData()['RESULT'] ?? null;
30 }
31
36 public function hasResult(): bool
37 {
38 return $this->isSuccess() && $this->hasResult;
39 }
40
41 public static function merge(Result ...$results): Result
42 {
43 $mergedResult = new Result();
44 $dataResults = [];
45
46 foreach ($results as $result)
47 {
48 if (!$result->isSuccess())
49 {
50 $mergedResult->addErrors($result->getErrors());
51 }
52 elseif ($result->hasResult)
53 {
54 $dataResults[] = $result->getResult();
55 }
56 }
57
58 if (!empty($dataResults))
59 {
60 $mergedResult->setResult(array_merge(...$dataResults));
61 }
62
63 return $mergedResult;
64 }
65}
setResult($result)
Определения Result.php:17
bool $hasResult
Определения Result.php:10
static merge(Result ... $results)
Определения Result.php:41
getResult()
Определения Result.php:27
hasResult()
Определения Result.php:36
Определения result.php:20
isSuccess($internalCall=false)
Определения result.php:47
$result
Определения get_property_values.php:14
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393