MysqliDb::__construct PHP Method

__construct() public method

public __construct ( string $host = null, string $username = null, string $password = null, string $db = null, integer $port = null, string $charset = 'utf8' )
$host string
$username string
$password string
$db string
$port integer
$charset string
    public function __construct($host = null, $username = null, $password = null, $db = null, $port = null, $charset = 'utf8')
    {
        $isSubQuery = false;
        // if params were passed as array
        if (is_array($host)) {
            foreach ($host as $key => $val) {
                ${$key} = $val;
            }
        }
        // if host were set as mysqli socket
        if (is_object($host)) {
            $this->_mysqli = $host;
        } else {
            $this->host = $host;
        }
        $this->username = $username;
        $this->password = $password;
        $this->db = $db;
        $this->port = $port;
        $this->charset = $charset;
        if ($isSubQuery) {
            $this->isSubQuery = true;
            return;
        }
        if (isset($prefix)) {
            $this->setPrefix($prefix);
        }
        self::$_instance = $this;
    }