<?php
namespace Application\Service\DB\Admin;

use Interop\Container\ContainerInterface;

class Role extends \Application\Service\DB\AbstractDb
{
    public const MASKING_ADMIN_CODE = 'MaskingAdmin';
    public function __construct($dbAdapter, ContainerInterface $container)
    {
        $this->tableName = 'yikeen_admin_role';
        parent::__construct($dbAdapter, $container);
    }

    public function getAdminRoleData($whereData=[],$type = 0,$field=''){
        $data = [];
        switch ($type){
            case 1:
                $data = $this->LocalService()->adminRole->fetchAll($whereData);
                break;
            case 2:
                $data = $this->LocalService()->adminRole->fetchOne($whereData);
                break;
            case 3:
                $data = $this->LocalService()->adminRole->fetchCol($field,$whereData);
                break;
            default:
                $data['data'] = $this->LocalService()->adminRole->fetchAll($whereData);
                $data['count'] = $this->LocalService()->adminRole->getCount($whereData['where']);
                break;
        }
        return $data ;
    }
}