statusInfo = new ImsLtiServiceResponseStatus(); $this->xmlHeaderInfo = $xml->imsx_POXHeader->imsx_POXRequestHeaderInfo; $this->xmlRequest = $xml->imsx_POXBody->children(); } /** * @return ImsLtiServiceResponse|null */ public function process() { $this->processHeader(); $this->processBody(); return $this->generateResponse(); } protected function processHeader() { $info = $this->xmlHeaderInfo; $this->statusInfo->setMessageRefIdentifier($info->imsx_messageIdentifier); error_log("Service Request: tool version {$info->imsx_version} message ID {$info->imsx_messageIdentifier}"); } abstract protected function processBody(); /** * @return ImsLtiServiceResponse|null */ private function generateResponse() { $response = ImsLtiServiceResponseFactory::create( $this->responseType, $this->statusInfo, $this->responseBodyParam ); return $response; } }