1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Promotion.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
10
11class Promotion implements RestConvertible
12{
13 #[NotEmpty]
14 private string $id;
15 #[Validatable]
16 private PromotionParams $params;
17
18 public function __construct(string $id, array $params = [])
19 {
20 $this->id = $id;
21 $this->params = PromotionParams::createFromArray($params);
22 }
23
24 public function setChatId(int $chatId): self
25 {
26 $this->params->setChatId($chatId);
27
28 return $this;
29 }
30
31 public function getChatId(): ?int
32 {
33 return $this->params->getChatId();
34 }
35
36 public function getId(): string
37 {
38 return $this->id;
39 }
40
41 public static function getRestEntityName(): string
42 {
43 return 'promotion';
44 }
45
46 public function toRestFormat(array $option = []): array
47 {
48 return [
49 'id' => $this->id,
50 'params' => $this->params->toRestFormat(),
51 ];
52 }
53}
static getRestEntityName()
Определения Promotion.php:41
toRestFormat(array $option=[])
Определения Promotion.php:46
setChatId(int $chatId)
Определения Promotion.php:24
__construct(string $id, array $params=[])
Определения Promotion.php:18
static createFromArray(array $params)
Определения PromotionParams.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$option
Определения options.php:1711