private function createRequest(LocatorRequest $locatorRequest, $requestOption)
    {
        $xml = new DOMDocument();
        $xml->formatOutput = true;

        $trackRequest = $xml->appendChild($xml->createElement('LocatorRequest'));
        $trackRequest->setAttribute('xml:lang', 'en-US');

        $request = $trackRequest->appendChild($xml->createElement('Request'));

        $node = $xml->importNode($this->createTransactionNode(), true);
        $request->appendChild($node);

        $request->appendChild($xml->createElement('RequestAction', 'Locator'));
        $request->appendChild($xml->createElement('RequestOption', $requestOption));

        // Origin Address
        $trackRequest->appendChild($locatorRequest->getOriginAddress()->toNode($xml));

        // Translate
        $trackRequest->appendChild($locatorRequest->getTranslate()->toNode($xml));

        // Unit of measurement
        if ($locatorRequest->getUnitOfMeasurement()) {
            $trackRequest->appendChild($locatorRequest->getUnitOfMeasurement()->toNode($xml));
        }

        // LocationSearchCriteria
        if ($locatorRequest->getLocationSearchCriteria()) {
            $trackRequest->appendChild($locatorRequest->getLocationSearchCriteria()->toNode($xml));
        }

        return $xml->saveXML();
    }
private function createRequest(LocatorRequest $locatorRequest, $requestOption)
    {
        $xml = new DOMDocument();
        $xml->formatOutput = true;

        $trackRequest = $xml->appendChild($xml->createElement('LocatorRequest'));
        $trackRequest->setAttribute('xml:lang', 'en-US');

        $request = $trackRequest->appendChild($xml->createElement('Request'));

        $node = $xml->importNode($this->createTransactionNode(), true);
        $request->appendChild($node);

        $request->appendChild($xml->createElement('RequestAction', 'Locator'));
        $request->appendChild($xml->createElement('RequestOption', $requestOption));

        
        $trackRequest->appendChild($locatorRequest->getOriginAddress()->toNode($xml));

        
        $trackRequest->appendChild($locatorRequest->getTranslate()->toNode($xml));

        
        if ($locatorRequest->getUnitOfMeasurement()) {
            $trackRequest->appendChild($locatorRequest->getUnitOfMeasurement()->toNode($xml));
        }

        
        if ($locatorRequest->getLocationSearchCriteria()) {
            $trackRequest->appendChild($locatorRequest->getLocationSearchCriteria()->toNode($xml));
        }

        return $xml->saveXML();
    }
private function createRequest ( LocatorRequest $ locatorRequest , $ requestOption ) { $ xml = new DOMDocument ( ) ; $ xml -> formatOutput = true ; $ trackRequest = $ xml -> appendChild ( $ xml -> createElement ( 'LocatorRequest' ) ) ; $ trackRequest -> setAttribute ( 'xml:lang' , 'en-US' ) ; $ request = $ trackRequest -> appendChild ( $ xml -> createElement ( 'Request' ) ) ; $ node = $ xml -> importNode ( $ this -> createTransactionNode ( ) , true ) ; $ request -> appendChild ( $ node ) ; $ request -> appendChild ( $ xml -> createElement ( 'RequestAction' , 'Locator' ) ) ; $ request -> appendChild ( $ xml -> createElement ( 'RequestOption' , $ requestOption ) ) ; // Origin Address $ trackRequest -> appendChild ( $ locatorRequest -> getOriginAddress ( ) -> toNode ( $ xml ) ) ; // Translate $ trackRequest -> appendChild ( $ locatorRequest -> getTranslate ( ) -> toNode ( $ xml ) ) ; // Unit of measurement if ( $ locatorRequest -> getUnitOfMeasurement ( ) ) { $ trackRequest -> appendChild ( $ locatorRequest -> getUnitOfMeasurement ( ) -> toNode ( $ xml ) ) ; } // LocationSearchCriteria if ( $ locatorRequest -> getLocationSearchCriteria ( ) ) { $ trackRequest -> appendChild ( $ locatorRequest -> getLocationSearchCriteria ( ) -> toNode ( $ xml ) ) ; } return $ xml -> saveXML ( ) ; }
Create the TimeInTransit request.

@param LocatorRequest $locatorRequest The request details. Refer to the UPS documentation for available structure
@param integer $requestOption

@return string
Create the TimeInTransit request .