36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Equipment\Server;
|
|
|
|
use App\Entities\Equipment\ServerEntity;
|
|
use App\Services\Equipment\ServerPartService as ParentService;
|
|
use App\Interfaces\Equipment\ServerInterface;
|
|
|
|
class ServerPartService extends ParentService implements ServerInterface
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function createServer(ServerEntity $serverEntity): ServerEntity
|
|
{
|
|
//아무것도 하지 않음
|
|
return $serverEntity;
|
|
}
|
|
//create와 같은 작업임
|
|
public function modifyServer(ServerEntity $serverEntity): ServerEntity
|
|
{
|
|
//아무것도 하지 않음
|
|
return $serverEntity;
|
|
}
|
|
public function deleteServer(ServerEntity $serverEntity): ServerEntity
|
|
{
|
|
//기존 ServerPart정보 삭제
|
|
foreach ($this->getEntities(['serverinfo_uid' => $serverEntity->getPK()]) as $serverPartEntity) {
|
|
$this->getModel()->delete($serverPartEntity);
|
|
}
|
|
return $serverEntity;
|
|
}
|
|
}
|