Example #1
0
 /**
  * Instantiate the singleton if necessary and return it
  * @return object
  */
 public static function getInstance()
 {
     if (!is_object(static::$objInstance)) {
         static::$objInstance = new \Isotope\Rules();
     }
     return static::$objInstance;
 }
 /**
  * Instantiate a new user object (Factory)
  *
  * @return static The object instance
  */
 public static function getInstance()
 {
     if (static::$objInstance === null) {
         static::$objInstance = new static();
     }
     return static::$objInstance;
 }
 /**
  * Return the object instance (Singleton)
  *
  * @return \Session The object instance
  */
 public static function getInstance()
 {
     if (static::$objInstance === null) {
         static::$objInstance = CacheManager::getInstance(static::$driver, self::getOptions());
     }
     return static::$objInstance;
 }
Example #4
0
 /**
  * Return the object instance (Singleton)
  *
  * @return \String The object instance
  *
  * @deprecated Deprecated since Contao 4.0, to be removed in Contao 5.0.
  *             The String class is now static.
  */
 public static function getInstance()
 {
     trigger_error('Using String::getInstance() has been deprecated and will no longer work in Contao 5.0. The String class is now static.', E_USER_DEPRECATED);
     if (static::$objInstance === null) {
         static::$objInstance = new static();
     }
     return static::$objInstance;
 }
 /**
  * For test purposes use \Symfony\Component\HttpFoundation\Request::create() for dummy data
  * @param \Symfony\Component\HttpFoundation\Request $request
  *
  * @return \Environment
  */
 public static function set(\Symfony\Component\HttpFoundation\Request $request)
 {
     static::$objInstance = $request;
     return static::$objInstance;
 }
Example #6
0
File: User.php Project: rikaix/core
 /**
  * Instantiate a new user object (Factory)
  * 
  * @return \User The object instance
  */
 public static function getInstance()
 {
     if (!is_object(static::$objInstance)) {
         static::$objInstance = new static();
     }
     return static::$objInstance;
 }
Example #7
0
 /**
  * Instantiate the Database object (Factory)
  * 
  * @return \Database The Database object
  */
 public static function getInstance()
 {
     if (!is_object(static::$objInstance)) {
         $strClass = '\\Database_' . ucfirst(strtolower($GLOBALS['TL_CONFIG']['dbDriver']));
         static::$objInstance = new $strClass();
     }
     return static::$objInstance;
 }