private function getRecord()
    {
        $checks = [
            function () {
                if (!isset($this->params['identifier'])) {
                    throw new BadArgumentException("Missing required argument identifier");
                }
            },
            function () {
                if (!isset($this->params['metadataPrefix'])) {
                    throw new BadArgumentException("Missing required argument metadataPrefix");
                }
                $this->checkMetadataPrefix(
                    $this->params['metadataPrefix'],
                    isset($this->params['identifier']) ? $this->params['identifier'] : null
                );
            }
        ];
        $this->doChecks($checks);

        $record = $this->repository->getRecord($this->params['metadataPrefix'], $this->params['identifier']);
        $recordNode = $this->response->createElement('record');

        $header = $record->getHeader();
        $recordNode->appendChild($this->getRecordHeaderNode($header));

        // Only add metadata and about if the record is not deleted.
        if (!$header->isDeleted()) {
            $recordNode->appendChild($this->response->createElement('metadata'));

            // Push the record itself on the records stack
            array_push($this->records, $record->getMetadata());

            //only add an 'about' node if it's not null
            $about = $record->getAbout();
            if ($about !== null) {
                $recordNode->appendChild($this->response->createElement('about', $about));
            }
        }

        $getRecordNode = $this->response->createElement('GetRecord');
        $getRecordNode->appendChild($recordNode);

        return $getRecordNode;
    }
private function getRecord()
    {
        $checks = [
            function () {
                if (!isset($this->params['identifier'])) {
                    throw new BadArgumentException("Missing required argument identifier");
                }
            },
            function () {
                if (!isset($this->params['metadataPrefix'])) {
                    throw new BadArgumentException("Missing required argument metadataPrefix");
                }
                $this->checkMetadataPrefix(
                    $this->params['metadataPrefix'],
                    isset($this->params['identifier']) ? $this->params['identifier'] : null
                );
            }
        ];
        $this->doChecks($checks);

        $record = $this->repository->getRecord($this->params['metadataPrefix'], $this->params['identifier']);
        $recordNode = $this->response->createElement('record');

        $header = $record->getHeader();
        $recordNode->appendChild($this->getRecordHeaderNode($header));

        // Only add metadata and about if the record is not deleted.
        if (!$header->isDeleted()) {
            $recordNode->appendChild($this->response->createElement('metadata'));

            // Push the record itself on the records stack
            array_push($this->records, $record->getMetadata());

            //only add an 'about' node if it's not null
            $about = $record->getAbout();
            if ($about !== null) {
                $recordNode->appendChild($this->response->createElement('about', $about));
            }
        }

        $getRecordNode = $this->response->createElement('GetRecord');
        $getRecordNode->appendChild($recordNode);

        return $getRecordNode;
    }
private function getRecord ( ) { $ checks = [ function ( ) { if ( ! isset ( $ this -> params [ 'identifier' ] ) ) { throw new BadArgumentException ( "Missing required argument identifier" ) ; } } , function ( ) { if ( ! isset ( $ this -> params [ 'metadataPrefix' ] ) ) { throw new BadArgumentException ( "Missing required argument metadataPrefix" ) ; } $ this -> checkMetadataPrefix ( $ this -> params [ 'metadataPrefix' ] , isset ( $ this -> params [ 'identifier' ] ) ? $ this -> params [ 'identifier' ] : null ) ; } ] ; $ this -> doChecks ( $ checks ) ; $ record = $ this -> repository -> getRecord ( $ this -> params [ 'metadataPrefix' ] , $ this -> params [ 'identifier' ] ) ; $ recordNode = $ this -> response -> createElement ( 'record' ) ; $ header = $ record -> getHeader ( ) ; $ recordNode -> appendChild ( $ this -> getRecordHeaderNode ( $ header ) ) ; // Only add metadata and about if the record is not deleted. if ( ! $ header -> isDeleted ( ) ) { $ recordNode -> appendChild ( $ this -> response -> createElement ( 'metadata' ) ) ; // Push the record itself on the records stack array_push ( $ this -> records , $ record -> getMetadata ( ) ) ; //only add an 'about' node if it's not null $ about = $ record -> getAbout ( ) ; if ( $ about !== null ) { $ recordNode -> appendChild ( $ this -> response -> createElement ( 'about' , $ about ) ) ; } } $ getRecordNode = $ this -> response -> createElement ( 'GetRecord' ) ; $ getRecordNode -> appendChild ( $ recordNode ) ; return $ getRecordNode ; }
handles GetRecord requests
@return \DOMElement
@throws BadArgumentException
handles GetRecord requests