<?php

class RequestTransactionResult
{
    /**
     * @var Request
     */
    private $Request;

    /**
     * @var Response
     */
    private $response;

    /**
     * @var ResponseData
     */
    private $responseData;

    /**
     * Get the value of Request
     *
     * @return  Request
     */ 
    public function getRequest()
    {
        return $this->Request;
    }

    /**
     * Set the value of Request
     *
     * @param  Request  $Request
     *
     * @return  self
     */ 
    public function setRequest(Request $Request)
    {
        $this->Request = $Request;

        return $this;
    }

    public function setRequestbyObject($Request)
    {
        $request = new Request();
        $request->setTransaction($Request->Transaction->__toString());
        $request->setRequestor($Request->Requestor->__toString());
        $request->setRequestorActive($Request->RequestorActive->__toString());
        $request->setCountry($Request->Country->__toString());
        $request->setEntity($Request->Entity->__toString());
        $request->setUser($Request->User->__toString());
        $request->setUserName($Request->UserName->__toString());
        $request->setId($Request->Id->__toString());
        $request->setTimeStamp($Request->TimeStamp->__toString());
        return $this->setRequest($request);
    }

    /**
     * Get the value of response
     *
     * @return  Response
     */
    public function getResponse()
    {
        return $this->response;
    }

    /**
     * Set the value of response
     *
     * @param  Response  $response
     *
     * @return  self
     */
    public function setResponse(Response $response)
    {
        $this->response = $response;

        return $this;
    }

    public function setResponsebyObject($responseObject)
    {
        $response = new Response();
        // Object
        $response->setIdentifierbyObject($responseObject->Identifier);
        // String
        $response->setResult($responseObject->Result->__toString());
        $response->setTimeStamp($responseObject->TimeStamp->__toString());
        $response->setCode($responseObject->Code->__toString());
        $response->setDescription($responseObject->Description->__toString());
        $response->setHint($responseObject->Hint->__toString());
        $response->setProcessor($responseObject->Processor->__toString());
        return $this->setResponse($response);
    }

    /**
     * Get the value of responseData
     *
     * @return  ResponseData
     */ 
    public function getResponseData()
    {
        return $this->responseData;
    }

    /**
     * Set the value of responseData
     *
     * @param  ResponseData  $responseData
     *
     * @return  self
     */ 
    public function setResponseData(ResponseData $responseData)
    {
        $this->responseData = $responseData;

        return $this;
    }

    public function setResponseDatabyObject($responseDataObject)
    {
        $responseData = new ResponseData();
        if ($responseDataObject->ResponseData1) {
            $responseData->setResponseData1($responseDataObject->ResponseData1->__toString());
        }
        if ($responseDataObject->ResponseData2) {
            $responseData->setResponseData2($responseDataObject->ResponseData2->__toString());
        }
        if ($responseDataObject->ResponseData3) {
            $responseData->setResponseData3($responseDataObject->ResponseData3->__toString());
        }
        return $this->setResponseData($responseData);
    }
}
