MyQEE\Server\Table::_driver PHP Method

_driver() protected method

protected _driver ( ) : mysqli | redis
return mysqli | redis
    protected function _driver()
    {
        if ($this->_driver) {
            return $this->_driver;
        }
        switch ($this->_type) {
            case 'mysql':
                $this->_driver = new \mysqli($this->_link['host'], $this->_link['user'], $this->_link['pass'], $this->_link['db'], $this->_link['port'] ?: 3306);
                $this->_driver->set_charset($this->_link['query']['charset'] ?: 'utf8');
                break;
        }
        return $this->_driver;
    }