<?php

namespace Hura8\Components\Customer\Controller;

use Hura8\Components\Customer\Model\CustomerModel;
use Hura8\Components\Province\AdminController\AProvinceController;
use Hura8\System\Controller\aEntityBaseController;

class bCustomerController extends aEntityBaseController
{

    /* @var CustomerModel $objCustomerModel */
    protected $objCustomerModel;

    /* @var AProvinceController $objProvinceController */
    protected $objProvinceController;

    public function __construct()
    {
        $this->objCustomerModel = new CustomerModel();
        $this->objProvinceController = new AProvinceController();
        parent::__construct($this->objCustomerModel);
    }


    public function formatItemInList(array $item_info)
    {
        return $this->formatItemInfo($item_info);
    }


    public function formatItemInfo(array $item_info)
    {
        $info = $item_info;
        $info['province_name'] = $this->objProvinceController->getProvinceName($item_info['province']);

        return $info;
    }

}
