/** * Singleton method that returns a unique instance of the class. * * @return FrontController */ private static function getInstance() { if (!self::$instance instanceof self) { self::$instance = new self(); } return self::$instance; }
public static function getInstance() { if (self::$instance == false) { self::$instance = new FrontController(); } return self::$instance; }
/** * Returns an instance of FrontController object * @return FrontController */ public static function getInstance() { if (self::$instance === null) { self::$instance = new self(); } return self::$instance; }
public static function getInstance() { if (f::isEmpty(self::$instance)) { $class = __CLASS__; self::$instance = new $class(); } return self::$instance; }
/** * getInstance - just one instance of the object is allowed (it makes no sense to have more) * * @access public static * @param $rootPath * @return object (instance) */ public static function getInstance($rootPath = null) { if (is_object(self::$instance) === false) { if (is_null($rootPath)) { throw new Exception('No root path'); } self::$instance = new FrontController($rootPath); } return self::$instance; }
/** * the getInstance() method returns a single instance of the object */ public static function getInstance() { if (!isset(self::$instance)) { spl_autoload_register(array('FrontController', 'autoLoad')); $object = __CLASS__; self::$instance = new $object(); self::$instance->initApp(); } return self::$instance; }