lib/IXF/ApiResource.php
public static function resolveClass( $resource, $id = null )
    {
        $class = 'IXF\\' . $resource;
        if( class_exists($class) )
            return new $class( $id );

        return new IXF\ApiResource( $id );
    }
public static function resolveClass( $resource, $id = null )
    {
        $class = 'IXF\\' . $resource;
        if( class_exists($class) )
            return new $class( $id );

        return new IXF\ApiResource( $id );
    }
public static function resolveClass ( $ resource , $ id = null ) { $ class = 'IXF\\' . $ resource ; if ( class_exists ( $ class ) ) return new $ class ( $ id ) ; return new IXF \ ApiResource ( $ id ) ; }
If a class exists for the given resource return an instance
of it, else return an instance of the generic ApiResouce class.

@param string $resource The resource - e.g. ''IXP''
@param int    $id       ID of the object - use for initialisation
@return ApiResouce Or the more specific child class
If a class exists for the given resource return an instance of it else return an instance of the generic ApiResouce class .