src/Bigcommerce/Api/Client.php
private static function mapResource($resource, $object)
    {
        if ($object == false || is_string($object)) {
            return $object;
        }

        $baseResource = __NAMESPACE__ . '\\' . $resource;
        $class = (class_exists($baseResource)) ? $baseResource : 'Bigcommerce\\Api\\Resources\\' . $resource;
        return new $class($object);
    }
private static function mapResource($resource, $object)
    {
        if ($object == false || is_string($object)) {
            return $object;
        }

        $baseResource = __NAMESPACE__ . '\\' . $resource;
        $class = (class_exists($baseResource)) ? $baseResource : 'Bigcommerce\\Api\\Resources\\' . $resource;
        return new $class($object);
    }
private static function mapResource ( $ resource , $ object ) { if ( $ object == false || is_string ( $ object ) ) { return $ object ; } $ baseResource = __NAMESPACE__ . '\\' . $ resource ; $ class = ( class_exists ( $ baseResource ) ) ? $ baseResource : 'Bigcommerce\\Api\\Resources\\' . $ resource ; return new $ class ( $ object ) ; }
Map a single object to a resource class.

@param string $resource name of the resource class
@param \stdClass $object
@return Resource
Map a single object to a resource class .