Example #1
0
 public static function getInstance()
 {
     if (empty(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
 /**
  * Singleton
  * @return Context
  */
 public static function getContext()
 {
     if (!self::$_instance) {
         self::$_instanciable = true;
         self::$_instance = new self();
         self::$_instanciable = false;
     }
     return self::$_instance;
 }
Example #3
0
 /**
  * returns static context object (Singleton). It's to use Context without declaration of an object
  *
  * @return object Instance
  */
 public static function getInstance()
 {
     if (self::$_instance === null) {
         self::$_instance = new Context();
     }
     return self::$_instance;
 }