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

use Interop\Container\ContainerInterface;

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

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