1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
PromotionService.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Collab\Onboarding\Integration\Im\Promotion;
6
7use Bitrix\Main\DI\ServiceLocator;
8use Bitrix\Main\Loader;
9use Bitrix\Socialnetwork\Collab\Onboarding\Entity\JobCollection;
10use Bitrix\Socialnetwork\Collab\Onboarding\Integration\Im\Promotion\Update\PromotionUpdateDataFactory;
11
13{
14 private PromotionUpdateDataFactory $updateDataFactory;
15
16 public function __construct()
17 {
18 $this->updateDataFactory = PromotionUpdateDataFactory::getInstance();
19 }
20
24 public function onPromotionUpdate(array $sortedByUserJobs): void
25 {
26 if (empty($sortedByUserJobs))
27 {
28 return;
29 }
30
31 if (!Loader::includeModule('im'))
32 {
33 return;
34 }
35
36 $sortedByUserData = [];
37 foreach ($sortedByUserJobs as $userId => $jobs)
38 {
39 $promoUpdateData = $this->updateDataFactory->create($jobs);
40
41 if (null === $promoUpdateData)
42 {
43 continue;
44 }
45
46 $sortedByUserData[$userId] = $promoUpdateData;
47 }
48
49 $promoService = ServiceLocator::getInstance()->get('Im.Services.Promotion');
50 $promoService->handlePromotionUpdate($sortedByUserData);
51 }
52}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804