56 lines
1.2 KiB
PHP
56 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Part;
|
|
|
|
use App\Entities\Equipment\ServerPartEntity;
|
|
use App\Entities\Part\CPUEntity;
|
|
use App\Helpers\Part\CPUHelper;
|
|
use App\Interfaces\Equipment\ServerPartInterface;
|
|
use App\Models\Part\CPUModel;
|
|
|
|
|
|
class CPUService extends PartService implements ServerPartInterface
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct(new CPUModel(), new CPUHelper());
|
|
$this->addClassName('CPU');
|
|
}
|
|
public function getFormFields(): array
|
|
{
|
|
return [
|
|
"title",
|
|
"price",
|
|
"stock",
|
|
"status",
|
|
];
|
|
}
|
|
public function getFormFilters(): array
|
|
{
|
|
return [
|
|
'status',
|
|
];
|
|
}
|
|
public function getIndexFields(): array
|
|
{
|
|
return [
|
|
"title",
|
|
"price",
|
|
"stock",
|
|
"status",
|
|
];
|
|
}
|
|
public function getBatchjobFields(): array
|
|
{
|
|
return ['status'];
|
|
}
|
|
//기본 기능부분
|
|
//FieldForm관련용
|
|
//OrderBy 처리
|
|
public function setOrderBy(mixed $field = null, mixed $value = null): void
|
|
{
|
|
$this->getModel()->orderBy('title ASC');
|
|
parent::setOrderBy($field, $value);
|
|
}
|
|
}
|