当前位置: 首页>>代码示例>>PHP>>正文


PHP Opus_Document::getThesisPublisher方法代码示例

本文整理汇总了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());
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:18,代码来源:InstituteTest.php

示例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");
 }
开发者ID:esmo,项目名称:opus4-application,代码行数:27,代码来源:IndexControllerTest.php

示例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) {
开发者ID:alexukua,项目名称:opus4,代码行数:31,代码来源:update-dnbinstitute.php


注:本文中的Opus_Document::getThesisPublisher方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。