Пример #1
0
 /**
  * Return an instance of this class.
  *
  * @return object - The single instance of this class.
  */
 public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Пример #2
0
 /**
  * Get the class instance
  */
 public static function get_instance()
 {
     return null === self::$instance ? self::$instance = new self() : self::$instance;
 }