public function __construct() { if (self::$dbInstance === null) { self::$dbInstance = $this->getDatabaseInstance(); } $this->db = self::$dbInstance; }