28 lines
925 B
PHP
28 lines
925 B
PHP
<?php
|
|
|
|
namespace App\Services\Part;
|
|
|
|
use App\Entities\Equipment\ServerPartEntity;
|
|
use App\Entities\Part\PartEntity;
|
|
use App\Models\CommonModel;
|
|
use App\Services\CommonService;
|
|
|
|
abstract class PartService extends CommonService
|
|
{
|
|
protected function __construct(CommonModel $model)
|
|
{
|
|
parent::__construct($model);
|
|
$this->addClassPaths('Part');
|
|
}
|
|
abstract public function attachToServerPart(ServerPartEntity $serverPartEntity, array $formDatas = []): PartEntity;
|
|
abstract public function detachFromServerPart(ServerPartEntity $serverPartEntity, array $formDatas = []): PartEntity;
|
|
|
|
protected function modify_process($entity, array $formDatas): object
|
|
{
|
|
$fields = array_keys($formDatas);
|
|
$this->getFormService()->setFormFields($fields);
|
|
$this->getFormService()->setFormRules('modify', $fields);
|
|
return parent::modify_process($entity, $formDatas);
|
|
}
|
|
}
|