public function getConnection() { if (!self::$link) { self::$link = new mysqli($this->hostname, $this->username, $this->password, $this->database, $this->port); } /* do some exception/error stuff here maybe */ return self::$link; }