1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Promotion.php
См. документацию.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Bitrix\Im\V2\Promotion\Entity
;
6
7
use
Bitrix\Im\V2\Rest\RestConvertible
;
8
use
Bitrix\Main\Validation\Rule\NotEmpty
;
9
use
Bitrix\Main\Validation\Rule\Recursive\Validatable
;
10
11
class
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
}
Bitrix\Im\V2\Promotion\Entity\Promotion
Определения
Promotion.php:12
Bitrix\Im\V2\Promotion\Entity\Promotion\getChatId
getChatId()
Определения
Promotion.php:31
Bitrix\Im\V2\Promotion\Entity\Promotion\getRestEntityName
static getRestEntityName()
Определения
Promotion.php:41
Bitrix\Im\V2\Promotion\Entity\Promotion\getId
getId()
Определения
Promotion.php:36
Bitrix\Im\V2\Promotion\Entity\Promotion\toRestFormat
toRestFormat(array $option=[])
Определения
Promotion.php:46
Bitrix\Im\V2\Promotion\Entity\Promotion\setChatId
setChatId(int $chatId)
Определения
Promotion.php:24
Bitrix\Im\V2\Promotion\Entity\Promotion\__construct
__construct(string $id, array $params=[])
Определения
Promotion.php:18
Bitrix\Im\V2\Promotion\Entity\PromotionParams
Определения
PromotionParams.php:11
Bitrix\Im\V2\Promotion\Entity\PromotionParams\createFromArray
static createFromArray(array $params)
Определения
PromotionParams.php:15
Bitrix\Main\Validation\Rule\NotEmpty
Определения
NotEmpty.php:13
Bitrix\Main\Validation\Rule\Recursive\Validatable
Определения
Validatable.php:11
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Im\V2\Rest\RestConvertible
Определения
RestConvertible.php:6
Bitrix\Im\V2\Promotion\Entity
Определения
Promotion.php:5
$option
$option
Определения
options.php:1711
bitrix
modules
im
lib
V2
Promotion
Entity
Promotion.php
Создано системой
1.14.0