public static function getDatabase() { if (!self::$database) { $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING); self::$database = new PDO('mysql:host=localhost;dbname=db_here;port=3306;charset=utf8', 'user_here', 'password_here', $options); } return self::$database; }