public static function getInstance() { if (is_null(self::$instance)) { self::$instance = self::$mockmode ? new PreferencesMock() : new PreferencesImpl(); } return self::$instance; }
public static function getInstance() { if (empty(self::$instance)) { self::$instance = new Preferences(); } return self::$instance; }
public static function singleton($options = array()) { if (!isset(self::$instance)) { self::$instance = new Preferences($options); } return self::$instance; }
public static function getInstance() { if (empty(self::$instance)) { self::$instance = new Preferences(); // если экземпляр не создан, создаём его } return self::$instance; // получаем экземпляр объекта этого класса }
public static function getInstance() { if (!isset(self::$instance)) { try { self::$instance = new Preferences(); } catch (Exception $e) { return false; } } return self::$instance; }