本文整理汇总了PHP中Opus_Document::getThesisPublisher方法的典型用法代码示例。如果您正苦于以下问题:PHP Opus_Document::getThesisPublisher方法的具体用法?PHP Opus_Document::getThesisPublisher怎么用?PHP Opus_Document::getThesisPublisher使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Opus_Document
的用法示例。
在下文中一共展示了Opus_Document::getThesisPublisher方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetModel
public function testGetModel()
{
$form = new Admin_Form_Document_Institute(Admin_Form_Document_Institute::ROLE_PUBLISHER);
$doc = new Opus_Document(146);
$publishers = $doc->getThesisPublisher();
$publisher = $publishers[0];
$publisherId = $publisher->getModel()->getId();
$form->getElement('Id')->setValue($doc->getId());
$form->getElement('Institute')->setValue($publisherId);
$model = $form->getModel();
$modelId = $model->getId();
$this->assertNotNull($model);
$this->assertNotNull($modelId);
$this->assertEquals($doc->getId(), $modelId[0]);
$this->assertEquals($publisherId, $modelId[1]);
$this->assertEquals('publisher', $modelId[2]);
$this->assertEquals($publisherId, $model->getModel()->getId());
}
示例2: 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");
}
示例3:
$docFinder = new Opus_DocumentFinder();
$docIds = $docFinder->setServerState('published');
if ($documentType != false) {
$docFinder->setType($documentType);
}
$docIds = $docFinder->ids();
_log(count($docIds) . " documents " . ($documentType != false ? "of type '{$documentType}' " : '') . "found");
foreach ($docIds as $docId) {
try {
$doc = new Opus_Document($docId);
if (count($doc->getFile()) == 0) {
_log("Document <{$docId}> has no files, skipping..");
continue;
}
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) {