<?php

namespace App\Controllers\Admin\Equipment\Part;

use App\Controllers\Admin\Equipment\EquipmentController;

use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;

abstract class PartController extends EquipmentController
{
    public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
    {
        parent::initController($request, $response, $logger);
    }
    protected function getFormFieldOption(string $field, array $options): array
    {
        switch ($field) {
            case 'clientinfo_uid':
                $temps = [];
                foreach ($this->getClientService()->getEntities() as $entity) {
                    $temps[$entity->getPK()] = $entity->getTitle();
                }
                $options[$field] = $temps;
                break;
            default:
                $options = parent::getFormFieldOption($field, $options);
                break;
        }
        return $options;
    }
    //Index,FieldForm관련
}
