37 lines
1.4 KiB
PHP
37 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Equipment\Server;
|
|
|
|
use App\Entities\Customer\ServiceEntity;
|
|
use App\Entities\Equipment\ServerEntity;
|
|
use App\Entities\Equipment\ServerPartEntity;
|
|
use App\Interfaces\Customer\ServiceInterface;
|
|
use App\Services\Equipment\ServerService;
|
|
|
|
class Service extends ServerService implements ServiceInterface
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
//서버연결정보용 등록
|
|
//서비스정보용 등록
|
|
public function setService(string $action, ServiceEntity $serviceEntity, array $serviceDatas = []): ServiceENtity
|
|
{
|
|
$entity = $this->getEntity($serviceDatas['serverinfo_uid']);
|
|
if (!($entity instanceof ServerEntity)) {
|
|
throw new \Exception("{$serviceDatas['serverinfo_uid']}에 해당하는 서버정보를 찾을수없습니다.");
|
|
}
|
|
$formDatas = [];
|
|
$formDatas['clientinfo_uid'] = $serviceEntity->getClientInfoUID();
|
|
$formDatas['serviceinfo_uid'] = $serviceEntity->getPK();
|
|
$formDatas['status'] = $serviceDatas['status'];
|
|
$entity = $this->modify($entity, $formDatas);
|
|
return $serviceEntity->setServerENtity($entity);
|
|
}
|
|
public function setServiceAmount(ServerPartEntity $serverPartEntity, array $serverPartDatas): ServerPartEntity
|
|
{
|
|
return $serverPartEntity;
|
|
}
|
|
}
|