<?php
/********************************************************************************
 * (c)1337 aheadware.com - All rights reserved
 ********************************************************************************/

/**
 * Class AHDB_Response_Service
 *
 * Processes responses from action controller
 */
class AHDB_Response_Service {
    /**
     * Main response handling function
     *
     * @param AHDB_Response_Abstract $response  General action controller response
     */
    public static function processResponse( AHDB_Response_Abstract $response ) {

        // If response is an html response
        // @todo Switch case on getType()
        if ( $response instanceof AHDB_Response_Html ) {

            // Output html
            echo $response->getHtml();
        } else if ( $response instanceof AHDB_Response_Redirect) {

            // Redirect to given URL is set
            $url = $response->getUrl();
            if ( is_string( $url ) ) {
                //RM_Admin_Utils_Helper::redirect( $url );
            }
        }
    }
}