<?php

namespace App\Services\Equipment\Part;

use App\Entities\Equipment\Part\StorageEntity;
use App\Models\Equipment\Part\StorageModel;

class StorageService extends PartService
{
    public function __construct()
    {
        parent::__construct();
        $this->addClassName('Storage');
    }
    public function getModelClass(): StorageModel
    {
        return new StorageModel();
    }
    public function getEntityClass(): StorageEntity
    {
        return new StorageEntity();
    }
    final public function getFormFields(): array
    {
        return [
            "model",
            "status",
        ];
    }
    final public function getFilterFields(): array
    {
        return ['status'];
    }
    final public function getBatchJobFields(): array
    {
        return ['status'];
    }
    public function getIndexFields(): array
    {
        return ['model', 'status'];
    }
    //List 검색용
    //OrderBy 처리
    public function setOrderBy(mixed $field = null, mixed $value = null): void
    {
        $this->getModel()->orderBy('model', 'ASC');
        parent::setOrderBy($field, $value);
    }
}
