Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
result.php
1<?php
10
14
16{
18 protected $wereErrorsChecked = false;
19
21 protected $object;
22
23 public function __construct()
24 {
25 parent::__construct();
26 }
27
31 public function getObject()
32 {
33 return $this->object;
34 }
35
39 public function setObject($object)
40 {
41 $this->object = $object;
42 }
43
52 public function isSuccess($internalCall = false)
53 {
54 if (!$internalCall && !$this->wereErrorsChecked)
55 {
56 $this->wereErrorsChecked = true;
57 }
58
59 return parent::isSuccess();
60 }
61
67 public function getErrors()
68 {
69 $this->wereErrorsChecked = true;
70
71 return parent::getErrors();
72 }
73
79 public function getErrorMessages()
80 {
81 $this->wereErrorsChecked = true;
82
83 return parent::getErrorMessages();
84 }
85
86 public function __destruct()
87 {
88 if (!$this->isSuccess && !$this->wereErrorsChecked)
89 {
90 // nobody interested in my errors :(
91 // make a warning (usually it should be written in log)
92 trigger_error(join('; ', $this->getErrorMessages()), E_USER_WARNING);
93 }
94 }
95}
isSuccess($internalCall=false)
Definition result.php:52