<?php

namespace ModulesGarden\OpenXchangeAddon\Core\App\Controllers\AppControllers;

use ModulesGarden\OpenXchangeAddon\Core\App\Controllers\Interfaces\AppController;
use ModulesGarden\OpenXchangeAddon\Core\App\Controllers\Instances\Http\AdminPageController;
use ModulesGarden\OpenXchangeAddon\Core\App\Controllers\Instances\Http\ClientPageController;

class Http extends \ModulesGarden\OpenXchangeAddon\Core\App\Controllers\AppController implements AppController
{
    public function getControllerInstanceClass ($callerName, $params)
    {
        //todo
        $functionName = str_replace($this->getModuleName() . '_', '', $callerName);
        switch ($functionName)
        {
            //HTTP controllers
            case 'output':
                return AdminPageController::class;
            case 'clientarea':
                return ClientPageController::class;
        }

        return null;
    }

    public function getModuleName ()
    {
        return 'OpenXchangeAddon';
    }
}
