1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
IntegrationService.php
См. документацию.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Bitrix\Rest\Service;
6
7
use Bitrix\Main\ModuleManager;
8
use Bitrix\Rest\Contract;
9
use Bitrix\Rest\Entity\Collection\IntegrationCollection;
10
11
class
IntegrationService
implements
Contract\Service\IntegrationService
12
{
13
public
function
__construct
(
14
private
readonly
Contract
\
Repository
\
IntegrationRepository
$integrationRepository,
15
)
16
{}
17
18
public
function
getPaidIntegrations
():
IntegrationCollection
19
{
20
if
(
ModuleManager::isModuleInstalled
(
'bitrix24'
))
21
{
22
$collection = $this->integrationRepository->getCloudPaidIntegrations();
23
}
24
else
25
{
26
$collection = $this->integrationRepository->getBoxedPaidIntegrations();
27
}
28
29
return
$collection;
30
}
31
32
public
function
hasPaidIntegrations
(): bool
33
{
34
return
ModuleManager::isModuleInstalled
(
'bitrix24'
)
35
? $this->integrationRepository->hasUserIntegrations()
36
: $this->integrationRepository->hasNotInWebhookUserIntegrations();
37
}
38
}
Bitrix\Main\ModuleManager\isModuleInstalled
static isModuleInstalled($moduleName)
Определения
modulemanager.php:125
Bitrix\Rest\Entity\Collection\IntegrationCollection
Определения
IntegrationCollection.php:11
Bitrix\Rest\Repository\IntegrationRepository
Определения
IntegrationRepository.php:14
Bitrix\Rest\Service\IntegrationService
Определения
IntegrationService.php:12
Bitrix\Rest\Service\IntegrationService\__construct
__construct(private readonly Contract\Repository\IntegrationRepository $integrationRepository,)
Определения
IntegrationService.php:13
Bitrix\Rest\Service\IntegrationService\hasPaidIntegrations
hasPaidIntegrations()
Определения
IntegrationService.php:32
Bitrix\Rest\Service\IntegrationService\getPaidIntegrations
getPaidIntegrations()
Определения
IntegrationService.php:18
Bitrix\Rest\Contract\Service\IntegrationService
Определения
IntegrationService.php:10
Bitrix\Main\Type\Contract
Определения
arrayable.php:3
Bitrix\Rest\Contract\Repository
bitrix
modules
rest
lib
Service
IntegrationService.php
Создано системой
1.14.0