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


PHP Opus_Document::getSeries方法代码示例

本文整理汇总了PHP中Opus_Document::getSeries方法的典型用法代码示例。如果您正苦于以下问题:PHP Opus_Document::getSeries方法的具体用法?PHP Opus_Document::getSeries怎么用?PHP Opus_Document::getSeries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Opus_Document的用法示例。


在下文中一共展示了Opus_Document::getSeries方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: seriesNumber

 /**
  * Returns the number of a document in a series.
  * @param Opus_Document $document
  * @param Opus_Series $series
  * @return string
  */
 public function seriesNumber($document, $series)
 {
     foreach ($document->getSeries() as $linkedSeries) {
         if ($linkedSeries->getModel()->getId() === $series->getId()) {
             return htmlspecialchars($linkedSeries->getNumber());
         }
     }
     return '';
 }
开发者ID:alexukua,项目名称:opus4,代码行数:15,代码来源:SeriesNumber.php

示例2: testGetModel

 public function testGetModel()
 {
     $form = new Admin_Form_Document_Series();
     $doc = new Opus_Document(146);
     $series = $doc->getSeries();
     $form->getElement('Id')->setValue($doc->getId());
     $form->getElement('SeriesId')->setValue($series[0]->getModel()->getId());
     $form->getElement('Number')->setValue('b');
     $form->getElement('SortOrder')->setValue(7);
     $model = $form->getModel();
     $modelId = $model->getId();
     $this->assertEquals(146, $modelId[0]);
     $this->assertEquals($series[0]->getModel()->getId(), $modelId[1]);
     $this->assertEquals('b', $model->getNumber());
     $this->assertEquals(7, $model->getDocSortOrder());
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:16,代码来源:SeriesTest.php

示例3: foreach

        echo "sorting documents in series #" . $series->getId() . " numerically\n";
        if (!asort($seriesNumbers, SORT_NUMERIC)) {
            echo "Error while sorting docs -- skip series #" . $series->getId() . "\n";
            break;
        }
    } else {
        echo "sorting documents in series #" . $series->getId() . " lexicographically\n";
        if (!asort($seriesNumbers, SORT_STRING)) {
            echo "Error while sorting docs -- skip series #" . $series->getId() . "\n";
            break;
        }
    }
    $seriesCounter = 0;
    foreach ($seriesNumbers as $docId => $seriesNumber) {
        $doc = new Opus_Document($docId);
        $allSeries = $doc->getSeries();
        $doc->setSeries(array());
        $doc->store();
        foreach ($allSeries as $docSeries) {
            $seriesInstance = $docSeries->getModel();
            if ($seriesInstance->getId() === $series->getId()) {
                echo "reassign doc_sort_order for doc #" . $doc->getId() . " (series number: " . $docSeries->getNumber() . ") -- old / new doc_sort_order: " . $docSeries->getDocSortOrder() . " / " . $seriesCounter . "\n";
                $doc->addSeries($seriesInstance)->setNumber($docSeries->getNumber())->setDocSortOrder($seriesCounter++);
            } else {
                $doc->addSeries($seriesInstance)->setNumber($docSeries->getNumber())->setDocSortOrder($docSeries->getDocSortOrder());
            }
        }
        $doc->store();
    }
}
exit;
开发者ID:alexukua,项目名称:opus4,代码行数:31,代码来源:reassign_doc_sort_order.php

示例4: testXMetaDissPlusDctermsispartofContainsSeriesTitleAndNumber

 public function testXMetaDissPlusDctermsispartofContainsSeriesTitleAndNumber()
 {
     $doc = new Opus_Document(146);
     $series = $doc->getSeries();
     $this->dispatch('/oai?verb=GetRecord&metadataPrefix=XMetaDissPlus&identifier=oai::146');
     $response = $this->getResponse();
     $xpath = $this->prepareXpathFromResultString($response->getBody());
     $dctermsIspartof = $xpath->query('//xMetaDiss:xMetaDiss/dcterms:isPartOf');
     $this->assertEquals(1, $dctermsIspartof->length);
     $this->assertEquals($series[0]->getTitle() . ' ; ' . $series[0]->getNumber(), $dctermsIspartof->item(0)->nodeValue);
 }
开发者ID:esmo,项目名称:opus4-application,代码行数:11,代码来源:IndexControllerTest.php

示例5: testSeries149InVisible

 /**
  * Regression test for OPUSVIER-2232
  */
 public function testSeries149InVisible()
 {
     $d = new Opus_Document(149);
     $seriesIds = array();
     $seriesNumbers = array();
     foreach ($d->getSeries() as $series) {
         $seriesIds[] = $series->getModel()->getId();
         $seriesNumbers[] = $series->getNumber();
     }
     $this->assertContains('3', $seriesIds);
     $this->assertContains('4', $seriesIds);
     $this->assertContains('id-3-is-invisible', $seriesNumbers);
     $this->assertContains('id-4-is-visible', $seriesNumbers);
     $this->dispatch('/frontdoor/index/index/docId/149');
     $this->assertResponseCode(200);
     $responseBody = $this->getResponse()->getBody();
     // series 3 is NOT visible
     $this->assertNotContains('id-3-is-invisible', $responseBody);
     $this->assertNotRegExp('/href="\\/solrsearch\\/index\\/search\\/searchtype\\/series\\/id\\/3"/', $responseBody);
     // series 4 is visible
     $this->assertContains('id-4-is-visible', $responseBody);
     $this->assertRegExp('/href="\\/solrsearch\\/index\\/search\\/searchtype\\/series\\/id\\/4"/', $responseBody);
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:26,代码来源:IndexControllerTest.php


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