src/FilterSetting/Perimetersearch.php
protected function getObjectFromName($lookupClassName)
    {
        // Check if we know this class.
        if (!isset($GLOBALS['METAMODELS']['filters']['perimetersearch']['resolve_class'][$lookupClassName])) {
            return null;
        }

        $reflectionName = $GLOBALS['METAMODELS']['filters']['perimetersearch']['resolve_class'][$lookupClassName];

        $reflection = new \ReflectionClass($reflectionName);

        // Fetch singleton instance.
        if ($reflection->hasMethod('getInstance')) {
            $getInstanceMethod = $reflection->getMethod('getInstance');

            // Create a new instance.
            if ($getInstanceMethod->isStatic()) {
                return $getInstanceMethod->invoke(null);
            }

            return $reflection->newInstance();
        }

        // Create a normal object.
        return $reflection->newInstance();
    }
protected function getObjectFromName($lookupClassName)
    {
        // Check if we know this class.
        if (!isset($GLOBALS['METAMODELS']['filters']['perimetersearch']['resolve_class'][$lookupClassName])) {
            return null;
        }

        $reflectionName = $GLOBALS['METAMODELS']['filters']['perimetersearch']['resolve_class'][$lookupClassName];

        $reflection = new \ReflectionClass($reflectionName);

        // Fetch singleton instance.
        if ($reflection->hasMethod('getInstance')) {
            $getInstanceMethod = $reflection->getMethod('getInstance');

            // Create a new instance.
            if ($getInstanceMethod->isStatic()) {
                return $getInstanceMethod->invoke(null);
            }

            return $reflection->newInstance();
        }

        // Create a normal object.
        return $reflection->newInstance();
    }
protected function getObjectFromName ( $ lookupClassName ) { // Check if we know this class. if ( ! isset ( $ GLOBALS [ 'METAMODELS' ] [ 'filters' ] [ 'perimetersearch' ] [ 'resolve_class' ] [ $ lookupClassName ] ) ) { return null ; } $ reflectionName = $ GLOBALS [ 'METAMODELS' ] [ 'filters' ] [ 'perimetersearch' ] [ 'resolve_class' ] [ $ lookupClassName ] ; $ reflection = new \ ReflectionClass ( $ reflectionName ) ; // Fetch singleton instance. if ( $ reflection -> hasMethod ( 'getInstance' ) ) { $ getInstanceMethod = $ reflection -> getMethod ( 'getInstance' ) ; // Create a new instance. if ( $ getInstanceMethod -> isStatic ( ) ) { return $ getInstanceMethod -> invoke ( null ) ; } return $ reflection -> newInstance ( ) ; } // Create a normal object. return $ reflection -> newInstance ( ) ; }
Try to get a object from the given class.

@param string $lookupClassName The name of the class.

@return null|object

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)
Try to get a object from the given class .