<?php

namespace App\Services;

use App\Entities\Customer\ServiceEntity;
use App\Entities\MyLogEntity;
use App\Helpers\MyLogHelper;
use App\Models\MyLogModel;
use App\Services\CommonService;

class MyLogService extends CommonService
{
    public function __construct()
    {
        parent::__construct(new MyLogModel(), new MyLogHelper());
        $this->addClassName('MyLog');
    }
    public function getFormFields(): array
    {
        return [
            "title",
            "content",
            "status",
        ];
    }
    public function getFormFilters(): array
    {
        return [
            'user_uid',
            'status'
        ];
    }
    public function getBatchjobFields(): array
    {
        return ['status'];
    }
    //기본 기능부분
    //FieldForm관련용
    //List 검색용
    public function index_condition_filterWord(string $word): void
    {
        $this->getModel()->orLike($this->getModel()::TABLE . "." . $this->getModel()::TITLE, $word, 'both');
        $this->getModel()->orLike($this->getModel()::TABLE . '.content', $word, 'both');
    }
}
