1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
ChangeBlock.php
См. документацию.
1
<?php
2
declare(strict_types=1);
3
4
namespace
Bitrix\Landing\Copilot\Generation\Scenario;
5
6
use Bitrix\Landing\Copilot\Connector;
7
use Bitrix\Landing\Copilot\Connector\Chat\ICopilotChatBot;
8
use Bitrix\Landing\Copilot\Generation;
9
use Bitrix\Landing\Copilot\Generation\Step;
10
11
class
ChangeBlock
extends
BaseScenario
12
{
13
protected
const
EVENT_FINISH
=
'onChangeBlockFinish'
;
14
18
public
function
getMap
():
array
19
{
20
return
[
21
10 =>
new
Step\RequestBlockContent
(),
22
15 =>
new
Step\TaskPresaveBlocksHistory
(),
23
20 =>
new
Step\TaskUpdateBlock
(),
24
30 =>
new
Step\RequestImages
(),
25
40 =>
new
Step\TaskSaveBlocksHistory
(),
26
1000 =>
new
Step\Finish
(),
27
];
28
}
29
33
public
function
getChatbot
(): ?
ICopilotChatBot
34
{
35
return
Connector\Chat\Chat::getChangeBlockChatBot
();
36
}
37
43
public
function
getQuotaCalculateStep
(): int
44
{
45
return
10;
46
}
47
51
public
function
onFinish
(
Generation
$generation): void
52
{
53
$chatId = $generation->
getChatId
();
54
if
(!isset($chatId) || $chatId <= 0)
55
{
56
return
;
57
}
58
59
$this->
getChatbot
()?->sendGenerationEndMessage(
60
new
Connector
\
Chat
\
ChatBotMessageDto
($chatId, $generation->
getId
())
61
);
62
$generation->
getEvent
()->send(
63
self::EVENT_FINISH,
64
[
65
'blockData'
=> $generation->
getBlocksData
($generation->
getSiteData
()->getBlocks()),
66
],
67
);
68
}
69
}
Bitrix\Landing\Copilot\Connector\Chat\ChatBotMessageDto
Определения
ChatBotMessageDto.php:9
Bitrix\Landing\Copilot\Connector\Chat\Chat\getChangeBlockChatBot
static getChangeBlockChatBot()
Определения
Chat.php:39
Bitrix\Landing\Copilot\Generation\Scenario\BaseScenario
Определения
BaseScenario.php:7
Bitrix\Landing\Copilot\Generation\Scenario\ChangeBlock
Определения
ChangeBlock.php:12
Bitrix\Landing\Copilot\Generation\Scenario\ChangeBlock\EVENT_FINISH
const EVENT_FINISH
Определения
ChangeBlock.php:13
Bitrix\Landing\Copilot\Generation\Scenario\ChangeBlock\getQuotaCalculateStep
getQuotaCalculateStep()
Определения
ChangeBlock.php:43
Bitrix\Landing\Copilot\Generation\Scenario\ChangeBlock\onFinish
onFinish(Generation $generation)
Определения
ChangeBlock.php:51
Bitrix\Landing\Copilot\Generation\Scenario\ChangeBlock\getMap
getMap()
Определения
ChangeBlock.php:18
Bitrix\Landing\Copilot\Generation\Scenario\ChangeBlock\getChatbot
getChatbot()
Определения
ChangeBlock.php:33
Bitrix\Landing\Copilot\Generation\Step\Finish
Определения
Finish.php:7
Bitrix\Landing\Copilot\Generation\Step\RequestBlockContent
Определения
RequestBlockContent.php:22
Bitrix\Landing\Copilot\Generation\Step\RequestImages
Определения
RequestImages.php:20
Bitrix\Landing\Copilot\Generation\Step\TaskPresaveBlocksHistory
Определения
TaskPresaveBlocksHistory.php:11
Bitrix\Landing\Copilot\Generation\Step\TaskSaveBlocksHistory
Определения
TaskSaveBlocksHistory.php:11
Bitrix\Landing\Copilot\Generation\Step\TaskUpdateBlock
Определения
TaskUpdateBlock.php:13
Bitrix\Landing\Copilot\Generation\getEvent
getEvent()
Определения
Generation.php:509
Bitrix\Landing\Copilot\Generation\getChatId
getChatId()
Определения
Generation.php:79
Bitrix\Landing\Copilot\Generation\getId
getId()
Определения
Generation.php:166
Bitrix\Landing\Copilot\Generation\getSiteData
getSiteData()
Определения
Generation.php:110
Bitrix\Landing\Copilot\Generation\getBlocksData
getBlocksData(array $blocks)
Определения
Generation.php:543
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\Landing\Copilot\Connector\Chat\ICopilotChatBot
Определения
ICopilotChatBot.php:7
Bitrix\Landing\Chat
Определения
binding.php:2
Bitrix\Landing\Connector
Определения
ai.php:3
Bitrix\Landing\Copilot\Generation
Определения
Error.php:4
bitrix
modules
landing
lib
Copilot
Generation
Scenario
ChangeBlock.php
Создано системой
1.14.0