本文整理汇总了PHP中Opus_Document::addSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP Opus_Document::addSubject方法的具体用法?PHP Opus_Document::addSubject怎么用?PHP Opus_Document::addSubject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Opus_Document
的用法示例。
在下文中一共展示了Opus_Document::addSubject方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rand
$isbn = $doc->addIdentifierIsbn();
$isbn->setValue('978-3-86680-192-9');
$issn = $doc->addIdentifierIssn();
$issn->setValue('1234-5678');
$doc->addIdentifierOpac()->setValue(randString($counter++));
//
// DnbInstitutes
//
$dnbInstitute = new Opus_DnbInstitute();
$dnbInstitute->setName(randString($counter++) . rand())->setAddress(randString($counter++))->setCity(randString($counter++))->setPhone(randString($counter++))->setDnbContactId(randString($counter++))->setIsGrantor(1)->store();
$doc->setThesisGrantor($dnbInstitute);
$doc->setThesisPublisher($dnbInstitute);
//
// Subjects
//
$doc->addSubject()->setType('swd')->setValue(randString($counter++));
foreach (array('uncontrolled', 'msc', 'ddc') as $type) {
$doc->addSubject()->setType($type)->setLanguage(randString($counter++))->setValue(randString($counter++))->setExternalKey(randString($counter++));
$doc->addSubject()->setType($type)->setLanguage("eng" . randString($counter++))->setValue(randString($counter++))->setExternalKey(randString($counter++));
$doc->addSubject()->setType($type)->setLanguage("deu")->setValue(randString($counter++))->setExternalKey(randString($counter++));
$doc->addSubject()->setType($type)->setLanguage("eng")->setValue(randString($counter++))->setExternalKey(randString($counter++));
}
//
// Notes
//
$doc->addNote()->setVisibility('public')->setMessage(randString($counter++));
$doc->addNote()->setVisibility('private')->setMessage(randString($counter++));
//
// Licenses
//
$lic = new Opus_Licence();
示例2:
$advisor->setLastName('Clever');
$advisor->store();
$doc->addPersonAdvisor($advisor);
$translator = new Opus_Person();
$translator->setFirstName('Erika');
$translator->setLastName('Fuchs');
$translator->store();
$doc->addPersonTranslator($translator);
$contributor = new Opus_Person();
$contributor->setFirstName('Jeff');
$contributor->setLastName('Smart');
$contributor->store();
$doc->addPersonContributor($contributor);
$doc->setCreatingCorporation('Walt Disney Creation Laboratories');
$doc->setContributingCorporation('Pixar Animation Studio');
$swd = $doc->addSubject()->setType('swd');
$swd->setValue('Test');
$freeSubjectDeu = $doc->addSubject()->setType('uncontrolled');
$freeSubjectDeu->setLanguage('deu')->setValue('Maustest');
$freeSubjectEng = $doc->addSubject()->setType('uncontrolled');
$freeSubjectEng->setLanguage('eng')->setValue('mouse test');
$note = $doc->addNote();
$note->setVisibility('public')->setMessage('ein Dokument, dass noch eine Bemerkung braucht, weil im Abstract nicht alles gesagt wurde...');
$noteTwo = $doc->addNote();
$noteTwo->setVisibility('private')->setMessage('und noch eine Bemerkung zum Bearbeitungsstand.');
$licences = Opus_Licence::getAll();
if (count($licences) >= 1) {
$lic = $licences[0];
} else {
$lic = new Opus_Licence();
$lic->setActive(1);
示例3: rand
* @copyright Copyright (c) 2008-2011, OPUS 4 development team
* @license http://www.gnu.org/licenses/gpl.html General Public License
* @version $Id$
*/
/**
* script to create 10000 documents, e.g., for performance testing
*/
for ($i = 1; $i < 10000; $i++) {
$d = new Opus_Document();
$d->setServerState('published');
$d->setType('preprint');
$d->setLanguage('deu');
$title = $d->addTitleMain();
$title->setLanguage('deu');
$title->setValue('title-' . rand());
$date = new Opus_Date();
$date->setNow();
$date->setYear(1990 + $i % 23);
$d->setPublishedDate($date);
$p = new Opus_Person();
$p->setFirstName("foo-" . $i % 7);
$p->setLastName("bar-" . $i % 5);
$p = $d->addPersonAuthor($p);
$c = new Opus_Collection(15990 + $i % 103);
$d->addCollection($c);
$s = $d->addSubject()->setType('ddc');
$s->setValue($i % 97);
$docId = $d->store();
echo "docId: {$docId}\n";
}
exit;
示例4: testIndexActionRisSubjectSwd
public function testIndexActionRisSubjectSwd()
{
$doc = new Opus_Document($this->documentId);
$doc->addSubject()->setType('swd')->setValue('SWD-Schlagwort');
$doc->store();
$this->dispatch('/citationExport/index/index/output/ris/docId/' . $this->documentId);
$this->assertResponseCode(200);
$response = $this->getResponse();
$this->assertContains('KW - SWD-Schlagwort', $response->getBody());
}
示例5:
$advisor->setLastName('Clever');
$advisor->store();
$doc->addPersonAdvisor($advisor);
$translator = new Opus_Person();
$translator->setFirstName('Erika');
$translator->setLastName('Fuchs');
$translator->store();
$doc->addPersonTranslator($translator);
$contributor = new Opus_Person();
$contributor->setFirstName('Jeff');
$contributor->setLastName('Smart');
$contributor->store();
$doc->addPersonContributor($contributor);
$doc->setCreatingCorporation('Walt Disney Creation Laboratories');
$doc->setContributingCorporation('Pixar Animation Studio');
$swd = $doc->addSubject()->setType('swd');
$swd->setValue('Test');
$free_subject_deu = $doc->addSubject()->setType('uncontrolled');
$free_subject_deu->setLanguage('deu')->setValue('Maustest');
$free_subject_eng = $doc->addSubject()->setType('uncontrolled');
$free_subject_eng->setLanguage('eng')->setValue('mouse test');
$note1 = $doc->addNote();
$note1->setVisibility('public')->setMessage('ein Dokument, dass noch eine Bemerkung braucht, weil im Abstract nicht alles gesagt wurde...');
$note2 = $doc->addNote();
$note2->setVisibility('private')->setMessage('und noch eine Bemerkung zum Bearbeitungsstand.');
$licences = Opus_Licence::getAll();
if (count($licences) >= 1) {
$lic = $licences[0];
} else {
$lic = new Opus_Licence();
$lic->setActive(1);
示例6: handleKeywords
/**
*
* @param DOMNode $node
* @param Opus_Document $doc
*/
private function handleKeywords($node, $doc)
{
foreach ($node->childNodes as $childNode) {
if ($childNode instanceof DOMElement) {
$s = new Opus_Subject();
$s->setLanguage(trim($childNode->getAttribute('language')));
$s->setType($childNode->getAttribute('type'));
$s->setValue(trim($childNode->textContent));
$doc->addSubject($s);
}
}
}