public static function singleton() {
        $returnValue = null;

        
        $serviceName = get_called_class();
        if (!isset(self::$instances[$serviceName])) {
            self::$instances[$serviceName] = new $serviceName();
        }

        $returnValue = self::$instances[$serviceName];
        

        return $returnValue;
    }
public static function singleton() {
        $returnValue = null;

        
        $serviceName = get_called_class();
        if (!isset(self::$instances[$serviceName])) {
            self::$instances[$serviceName] = new $serviceName();
        }

        $returnValue = self::$instances[$serviceName];
        

        return $returnValue;
    }
public static function singleton ( ) { $ returnValue = null ; $ serviceName = get_called_class ( ) ; if ( ! isset ( self :: $ instances [ $ serviceName ] ) ) { self :: $ instances [ $ serviceName ] = new $ serviceName ( ) ; } $ returnValue = self :: $ instances [ $ serviceName ] ; return $ returnValue ; }
returns an instance of the service the function was called from. Always
the same instance for a class

@access public
@author Joel Bout, <joel.bout@tudor.lu>
@return $this
returns an instance of the service the function was called from . Always the same instance for a class