1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
content.php
См. документацию.
1<?php
8namespace Bitrix\Sender\Internals\QueryController;
9
10use Bitrix\Main\Localization\Loc;
11use Bitrix\Main\Error;
12use Bitrix\Main\ErrorCollection;
13
14Loc::loadMessages(__FILE__);
15
20abstract class Content
21{
22 const TYPE_JSON = 'json';
23 const TYPE_HTML = 'html';
24
26 protected $errors;
27
29 protected $response;
30
31 public static function create (Response $response, $type)
32 {
33 switch ($type)
34 {
36 return new ContentHtml($response);
37
39 default:
40 return new ContentJson($response);
41 }
42 }
43
49 {
50 $this->errors = new ErrorCollection;
51 $this->response = $response;
52 }
53
57 public function onFlush()
58 {
59
60 }
61
65 abstract public function toText();
66
71 public function addError($message, $code = null)
72 {
73 $this->errors->setError(new Error($message, $code));
74 }
75
78 public function addPermissionError($message = null)
79 {
80 if (!$message)
81 {
82 $message = 'Access denied.';
83 }
84
85 $this->errors->setError(new Error($message, 0));
86 }
87
91 public function getErrorCollection()
92 {
93 return $this->errors;
94 }
95
96 protected function getErrorMessages()
97 {
98 $list = array();
99 foreach ($this->errors as $error)
100 {
102 $list[] = $error->getMessage();
103 }
104 return $list;
105 }
106}
$type
Определения options.php:106
Определения error.php:15
Определения response.php:5
__construct(Response $response)
Определения content.php:48
addError($message, $code=null)
Определения content.php:71
addPermissionError($message=null)
Определения content.php:78
static create(Response $response, $type)
Определения content.php:31
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$message
Определения payment.php:8
$error
Определения subscription_card_product.php:20