getEntity($serverPartEntity->getPartUID()); if (!$entity instanceof CSEntity) { throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 CS정보를 찾을수없습니다."); } //CS정보 수정 return $this->modify($entity, $formDatas); } public function createServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity { $formDatas = []; $formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID(); $formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID(); $formDatas['serverinfo_uid'] = $serverPartEntity->getServerInfoUID(); $formDatas['status'] = STATUS['OCCUPIED']; $entity = $this->action_process($serverPartEntity, $formDatas); return $serverPartEntity->setPartEntity($entity); } public function modifyServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity { return $this->createServerPart($serverPartEntity); } public function deleteServerPart(ServerPartEntity $serverPartEntity): ServerPartEntity { $formDatas = []; $formDatas['clientinfo_uid'] = null; $formDatas['serviceinfo_uid'] = null; $formDatas['serverinfo_uid'] = null; $formDatas['status'] = STATUS['AVAILABLE']; $entity = $this->action_process($serverPartEntity, $formDatas); return $serverPartEntity->setPartEntity($entity); } }