1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
SetCollabOptionsHandler.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Collab\Converter\Handler;
6
7use Bitrix\Main\DI\ServiceLocator;
8use Bitrix\Main\Result;
9use Bitrix\Socialnetwork\Collab\Control\Command\ValueObject\CollabOptions;
10use Bitrix\Socialnetwork\Collab\Control\Option\Command\SetOptionsCommand;
11use Bitrix\Socialnetwork\Collab\Converter\Command\AbstractConverterCommand;
12
14{
15 public function __construct(private readonly CollabOptions $options)
16 {
17 }
18
19 public function execute(AbstractConverterCommand $command): Result
20 {
21 $result = new Result();
22 $group = $command->getGroup();
23 $optionCommand = (new SetOptionsCommand())
24 ->setCollabId($group->getId())
25 ->setOptions($this->options)
26 ;
27
28 $service = ServiceLocator::getInstance()->get('socialnetwork.collab.option.service');
29
30 $optionResult = $service->set($optionCommand);
31
32 if (!$optionResult->isSuccess())
33 {
34 $result->addErrors($optionResult->getErrors());
35 }
36
37 return $result;
38 }
39}
__construct(private readonly CollabOptions $options)
Определения SetCollabOptionsHandler.php:15
$options
Определения commerceml2.php:49
$result
Определения get_property_values.php:14
$service
Определения payment.php:18