src/Connector/PowerOffice/Model/Factory/PowerOfficeFactory.php line 37
<?phpdeclare(strict_types=1);/*** Copyright (c) 2022 TECLA Consulting Group oü.* All rights reserved.** This unpublished material is proprietary to TECLA Consulting Group oü.* All rights reserved. The methods and* techniques described herein are considered trade secrets* and/or confidential. Reproduction or distribution, in whole* or in part, is forbidden except by express written permission* of TECLA Consulting Group oü.** @author Matúš Sýkorjak <matus@tecla.no>* @copyright 2022 TECLA Consulting Group oü*/namespace App\Connector\PowerOffice\Model\Factory;use App\Connector\PowerOffice\Dto\PowerOfficeDto;use App\Connector\PowerOffice\Model\Identity\PowerOfficeId;use App\Connector\PowerOffice\Model\PowerOffice;use App\Connector\PowerOffice\Model\PowerOfficeInterface;use App\Contact\Model\ContactInterface;use App\Contact\Repository\ContactRepositoryInterface;final class PowerOfficeFactory implements PowerOfficeFactoryInterface{private ContactRepositoryInterface $contactRepository;public function __construct(ContactRepositoryInterface $contactRepository){$this->contactRepository = $contactRepository;}public function create(ContactInterface $contact,string $apiClientKey = null,?int $pullInvoicesFromNumber = null,?string $accessToken = null,?\DateTimeImmutable $accessTokenExpiresAt = null,?string $refreshToken = null): PowerOfficeInterface {return new PowerOffice(PowerOfficeId::create(),$contact,$apiClientKey,$pullInvoicesFromNumber,$accessToken,$accessTokenExpiresAt,$refreshToken);}public function createFromDto(PowerOfficeDto $dto): PowerOfficeInterface{return $this->create($this->contactRepository->find($dto->getContact()),$dto->getApiClientKey(),$dto->getPullInvoicesFromNumber(),$dto->getAccessToken(),$dto->getAccessTokenExpiresAt(),$dto->getRefreshToken());}}