50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Uwil\ArcadiaApiPhpClient;
|
|
|
|
use Uwil\ArcadiaApiPhpClient\Factory\ApiClientFactory;
|
|
use Uwil\ArcadiaApiPhpClient\Factory\ServiceFactory;
|
|
use Uwil\ArcadiaApiPhpClient\Lib\ApiConfig;
|
|
use Uwil\ArcadiaApiPhpClient\Service\ApiService;
|
|
use Uwil\ArcadiaApiPhpClient\Service\BrandService;
|
|
use Uwil\ArcadiaApiPhpClient\Service\EmployeeService;
|
|
use Uwil\ArcadiaApiPhpClient\Service\IncoService;
|
|
|
|
class ArcadiaApiClient
|
|
{
|
|
private readonly ServiceFactory $serviceFactory;
|
|
|
|
public function __construct(
|
|
private readonly ApiConfig $apiConfig
|
|
) {
|
|
$apiClientFactory = new ApiClientFactory($this->apiConfig);
|
|
$apiClient = $apiClientFactory->createClient();
|
|
|
|
$this->serviceFactory = new ServiceFactory(
|
|
$apiClient,
|
|
$this->apiConfig
|
|
);
|
|
}
|
|
|
|
public function apiService(): ApiService
|
|
{
|
|
return $this->serviceFactory->createApiService();
|
|
}
|
|
|
|
public function employees(): EmployeeService
|
|
{
|
|
return $this->serviceFactory->createEmployeeService();
|
|
}
|
|
|
|
public function incoSheets(): IncoService
|
|
{
|
|
return $this->serviceFactory->createIncoService();
|
|
}
|
|
|
|
public function brands(): BrandService
|
|
{
|
|
return $this->serviceFactory->createBrandService();
|
|
}
|
|
}
|