public function setRequest($request = [])
    {
        if (!empty($request)) {
            if (is_array($request)) {
                foreach ((array) $request as $item) {
                    foreach ($item as $key => $value) {
                        if (empty($value)) {
                            $request['empty'] = 'true';
                        } else {
                            $request['empty'] = 'false';
                        }
                    }
                    break;
                }
                $this->_request = $request;

                return $this;
            } else {
                throw new \Exception('Initial request object must be an instance of an array!');
            }
        } else {
            throw new \Exception('An empty request object was given!');
        }
    }
public function setRequest($request = [])
    {
        if (!empty($request)) {
            if (is_array($request)) {
                foreach ((array) $request as $item) {
                    foreach ($item as $key => $value) {
                        if (empty($value)) {
                            $request['empty'] = 'true';
                        } else {
                            $request['empty'] = 'false';
                        }
                    }
                    break;
                }
                $this->_request = $request;

                return $this;
            } else {
                throw new \Exception('Initial request object must be an instance of an array!');
            }
        } else {
            throw new \Exception('An empty request object was given!');
        }
    }
public function setRequest ( $ request = [ ] ) { if ( ! empty ( $ request ) ) { if ( is_array ( $ request ) ) { foreach ( ( array ) $ request as $ item ) { foreach ( $ item as $ key => $ value ) { if ( empty ( $ value ) ) { $ request [ 'empty' ] = 'true' ; } else { $ request [ 'empty' ] = 'false' ; } } break ; } $ this -> _request = $ request ; return $ this ; } else { throw new \ Exception ( 'Initial request object must be an instance of an array!' ) ; } } else { throw new \ Exception ( 'An empty request object was given!' ) ; } }
Sets the request.

@param array $request - The request object

@throws \Exception

@return Request
Sets the request .