/** * Membuat instance kelas DB dengan pola Singleton * * @return DB */ public function getInstance() { if (!isset(self::$_instance)) { self::$_instance = new DB(); } return self::$_instance; }
public static function getInstance() { if (!self::$_instance) { // If no instance then make one self::$_instance = new self(); } return self::$_instance; }