本文整理汇总了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 '';
}
示例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());
}
示例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;
示例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);
}
示例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);
}