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


class Francis_Core_RequestData {
    protected $data = array();
    protected $params = array();
    protected $auth = array();

    public function __construct( array $data = array() ) {
        $this->data = $data;
        if ( isset( $this->data[ 'params' ] ) )
        {
            $this->params = $this->data[ 'params' ];
        }
        if ( isset( $this->data[ 'auth' ] ) )
        {
            $this->auth = $this->data[ 'auth' ];
        }
    }

    public function get( $key, $default = NULL )
    {
        if ( isset( $this->params[ $key ] ) ) {
            $v = is_string( $this->params[ $key ] ) ? trim( $this->params[ $key ] ) : $this->params[ $key ];
            return $v; //!empty( $v ) ? $v : NULL;
        } else {
            return $default;
        }
    }

    public function getAuth()
    {
        return $this->auth;
    }

    public function asArray() {
        return $this->data;
    }
} 