Exemplo n.º 1
0
 public static function getInstance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Exemplo n.º 2
0
 /**
  * Allow only one instance of this class exist
  * for a single request
  */
 public static function instance()
 {
     $called = get_called_class();
     if (self::$instance instanceof self) {
         return self::$instance;
     }
     return self::$instance = new self();
 }
Exemplo n.º 3
0
 public static function getInstance()
 {
     return self::$_instance ?: (self::$_instance = new self());
 }