本文整理匯總了PHP中Opus_Document::getThesisGrantor方法的典型用法代碼示例。如果您正苦於以下問題:PHP Opus_Document::getThesisGrantor方法的具體用法?PHP Opus_Document::getThesisGrantor怎麽用?PHP Opus_Document::getThesisGrantor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Opus_Document
的用法示例。
在下文中一共展示了Opus_Document::getThesisGrantor方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetRecordXMetaDissPlusDoc146ThesisAndDdb
/**
* Regression test for existing thesis:* and ddb:* elements
*/
public function testGetRecordXMetaDissPlusDoc146ThesisAndDdb()
{
$doc = new Opus_Document(146);
$this->assertEquals('masterthesis', $doc->getType(), 'testdata changed: document type changed');
$this->assertEquals('published', $doc->getServerState(), 'testdata changed: document state changed');
$this->assertEquals(2, count($doc->getThesisGrantor()), 'testdata changed: thesis grantor added to document');
$this->assertEquals(2, count($doc->getThesisPublisher()), 'testdata changed: thesis publisher added to document');
$this->dispatch('/oai?verb=GetRecord&metadataPrefix=XMetaDissPlus&identifier=oai::146');
$this->assertResponseCode(200);
$response = $this->getResponse();
$xpath = $this->prepareXpathFromResultString($response->getBody());
// Regression test for OPUSVIER-2452 - existing thesis:grantor element
$elements = $xpath->query('//thesis:degree/thesis:grantor');
$this->assertEquals(2, $elements->length, "Unexpected thesis:grantor count");
// Regression test for OPUSVIER-2523 - existing ddb:contact element
$elements = $xpath->query('//ddb:contact/@ddb:contactID');
$this->assertEquals(1, $elements->length, "Unexpected ddb:contact count");
$this->assertEquals('Lxxxx-xxxx', $elements->item(0)->nodeValue, "Wrong ddb:contact");
// Testing for other existing elements
$elements = $xpath->query('//thesis:degree/thesis:level[text()="master"]');
$this->assertEquals(1, $elements->length, "Unexpected thesis:level=='master' count");
$elements = $xpath->query('//thesis:degree/thesis:grantor/cc:universityOrInstitution/cc:name');
$this->assertEquals(2, $elements->length, "Unexpected thesis:level=='master' count");
}
示例2: catch
}
if (!is_null($thesisPublisherId)) {
$thesisPublisher = $doc->getThesisPublisher();
if (empty($thesisPublisher)) {
if (!$dryrun) {
$doc->setThesisPublisher($dnbInstitute);
$doc->store();
}
_log("Setting ThesisPublisher <{$thesisPublisherId}> on Document <{$docId}>");
} else {
$existingThesisPublisherId = $thesisPublisher[0]->getId();
_log("ThesisPublisher <{$existingThesisPublisherId[1]}> already set for Document <{$docId}>");
}
}
if (!is_null($thesisGrantorId)) {
$thesisGrantor = $doc->getThesisGrantor();
if (empty($thesisGrantor)) {
if (!$dryrun) {
$doc->setThesisGrantor($dnbInstitute);
$doc->store();
}
_log("Setting ThesisGrantor <{$thesisGrantorId}> on Document <{$docId}>");
} else {
$existingThesisGrantorId = $thesisGrantor[0]->getId();
_log("ThesisGrantor <{$existingThesisGrantorId[1]}> already set for Document <{$docId}>");
}
}
} catch (Exception $exc) {
_log("Error processing Document with ID {$docId}!");
_log($exc->getMessage());
}