Unnamed
public text v1 · immutable<?php
class DbLayer {
private static $instance = null;
private $db;
private function __construct(){
$instance = new self();
$instance->db = new PDO('mysql:host=127.0.0.1;dbname=themoves', ...
}
public static function getInstance(){
if(is_null(self::$instance)){
self::$instance = new self();
}
return self::$instance->$db;
}
}
?>