public function cast($request)
    {
        if (is_array($request) || is_object($request)) {
            foreach ($request as $key => $value) {
                if (is_array($value)) {
                    $this->cast($value);
                } else {
                    $this->$key = $value;
                }
            }
        }
    }
public function cast($request)
    {
        if (is_array($request) || is_object($request)) {
            foreach ($request as $key => $value) {
                if (is_array($value)) {
                    $this->cast($value);
                } else {
                    $this->$key = $value;
                }
            }
        }
    }
public function cast ( $ request ) { if ( is_array ( $ request ) || is_object ( $ request ) ) { foreach ( $ request as $ key => $ value ) { if ( is_array ( $ value ) ) { $ this -> cast ( $ value ) ; } else { $ this -> $ key = $ value ; } } } }
Casts the request array into new Request object.

@param array $request - The request object
Casts the request array into new Request object .