<?php

namespace lib\Controllers\Client;

use lib\Controllers\DBMSController;
use lib\Services\ClientService;

class ClientController extends DBMSController
{
    private ?ClientService $_clientService = null;
    public function __construct(array $params = [])
    {
        parent::__construct($params);
        $this->setPath('client');
    } //
    final public function getClientService(): ClientService
    {
        if ($this->_clientService === null) {
            $this->_clientService = new ClientService();
        }
        return $this->_clientService;
    }

    //사용자용메모장 , customer_memo.php
    //CLI 접속방법 : php index.php site/client/update_form/client_code/코드번호
    //WEB 접속방법 : http://localhost/site/client/update_form/client_code/코드번호
    public function update_form()
    {
        //기본적으로 필요한  client_code, mkid, service_code를 설정합니다.
        list($this->client, $this->member, $this->service) = $this->setDefaultRequestData(true, true);
        return $this->render(__FUNCTION__);
    }

    public function update()
    {
        //기본적으로 필요한  client_code, mkid, service_code를 설정합니다.
        list($this->client, $this->member, $this->service) = $this->setDefaultRequestData(true, true);
        return $this->render(__FUNCTION__);
    }
} //Class
