public function setResponseTransform(CNabuHTTPResponse $nb_response, string $interface_key = null)
    {
        if ($interface_key === null) {
            $nb_response->setTransformFactory(null);
        } else {
            $nb_engine = CNabuEngine::getEngine();
            $nb_descriptor = $nb_engine->getProviderInterfaceDescriptorByKey(
                CNabuProviderFactory::INTERFACE_RENDER_TRANSFORM,
                $interface_key
            );

            if ($nb_descriptor instanceof CNabuRenderTransformInterfaceDescriptor &&
                ($nb_pool_manager = $nb_engine->getRenderPoolManager()) instanceof CNabuRenderPoolManager &&
                ($nb_transform_factory = $nb_pool_manager->getTransformFactory($nb_descriptor))
                    instanceof CNabuRenderTransformFactory
            ) {
                $nb_response->setTransformFactory($nb_transform_factory);
            } else {
                throw new ENabuRenderException(
                    ENabuRenderException::ERROR_RENDER_TRANSFORM_NOT_FOUND,
                    array($interface_key)
                );
            }
        }

        return $this;
    }
public function setResponseTransform(CNabuHTTPResponse $nb_response, string $interface_key = null)
    {
        if ($interface_key === null) {
            $nb_response->setTransformFactory(null);
        } else {
            $nb_engine = CNabuEngine::getEngine();
            $nb_descriptor = $nb_engine->getProviderInterfaceDescriptorByKey(
                CNabuProviderFactory::INTERFACE_RENDER_TRANSFORM,
                $interface_key
            );

            if ($nb_descriptor instanceof CNabuRenderTransformInterfaceDescriptor &&
                ($nb_pool_manager = $nb_engine->getRenderPoolManager()) instanceof CNabuRenderPoolManager &&
                ($nb_transform_factory = $nb_pool_manager->getTransformFactory($nb_descriptor))
                    instanceof CNabuRenderTransformFactory
            ) {
                $nb_response->setTransformFactory($nb_transform_factory);
            } else {
                throw new ENabuRenderException(
                    ENabuRenderException::ERROR_RENDER_TRANSFORM_NOT_FOUND,
                    array($interface_key)
                );
            }
        }

        return $this;
    }
public function setResponseTransform ( CNabuHTTPResponse $ nb_response , string $ interface_key = null ) { if ( $ interface_key === null ) { $ nb_response -> setTransformFactory ( null ) ; } else { $ nb_engine = CNabuEngine :: getEngine ( ) ; $ nb_descriptor = $ nb_engine -> getProviderInterfaceDescriptorByKey ( CNabuProviderFactory :: INTERFACE_RENDER_TRANSFORM , $ interface_key ) ; if ( $ nb_descriptor instanceof CNabuRenderTransformInterfaceDescriptor && ( $ nb_pool_manager = $ nb_engine -> getRenderPoolManager ( ) ) instanceof CNabuRenderPoolManager && ( $ nb_transform_factory = $ nb_pool_manager -> getTransformFactory ( $ nb_descriptor ) ) instanceof CNabuRenderTransformFactory ) { $ nb_response -> setTransformFactory ( $ nb_transform_factory ) ; } else { throw new ENabuRenderException ( ENabuRenderException :: ERROR_RENDER_TRANSFORM_NOT_FOUND , array ( $ interface_key ) ) ; } } return $ this ; }
Sets the Response Render Transform Interface using their Interface Name.
@param CNabuHTTPResponse $nb_response HTTP Response instance.
@param string|null $interface_key Response Render Interface Key to search.
@return CNabuHTTPRendersManager Returns self pointer to grant setters chain.
Sets the Response Render Transform Interface using their Interface Name .