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


PHP Opus_Document::getEnrichment方法代码示例

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


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

示例1: setUp

 public function setUp()
 {
     parent::setUp();
     $document = $this->createTestDocument();
     $document->setServerState('unpublished');
     $document->setPersonReferee(array());
     $document->setEnrichment(array());
     $this->documentId = $document->store();
     $document = new Opus_Document($this->documentId);
     $this->assertEquals(0, count($document->getPersonReferee()));
     $this->assertEquals(0, count($document->getEnrichment()));
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:12,代码来源:IndexControllerTest.php

示例2: storeEnrichmentKeyValue

 /**
  * Add the given (key,value) to the documents enrichments.
  *
  * @param mixed $key
  * @param mixed $value
  * @return Matheon_Model_Document Fluent interface.
  */
 public function storeEnrichmentKeyValue($key, $value)
 {
     foreach ($this->_document->getEnrichment() as $e) {
         if ($e->getKeyName() == $key) {
             if ($e->getValue() == $value) {
                 return $this;
             }
         }
     }
     $this->_document->addEnrichment()->setKeyName($key)->setValue($value);
     return $this;
 }
开发者ID:KOBV,项目名称:opus4-matheon,代码行数:19,代码来源:Document.php

示例3: testStoreEnrichmentKeyValueSkipDuplicate

 public function testStoreEnrichmentKeyValueSkipDuplicate()
 {
     $doc = $this->createTestDocument();
     $docId = $doc->store();
     $this->assertEquals(0, count($doc->getEnrichment()));
     $mmd = new Matheon_Model_Document($docId);
     $mmd->storeEnrichmentKeyValue('reviewer.user_id', 123);
     $mmd->storeEnrichmentKeyValue('reviewer.user_id', 124);
     $mmd->storeEnrichmentKeyValue('reviewer.user_id', 123);
     $mmd->store();
     $doc = new Opus_Document($docId);
     $this->assertEquals(2, count($doc->getEnrichment()));
 }
开发者ID:KOBV,项目名称:opus4-matheon,代码行数:13,代码来源:DocumentTest.php

示例4: getSubmitter

 public function getSubmitter()
 {
     $return = array();
     foreach ($this->document->getEnrichment() as $e) {
         if ($e->getKeyName() != 'submitter.user_id') {
             continue;
         }
         $user_id = $e->getValue();
         $account = new Opus_Account($user_id);
         $return[$account->getId()] = strtolower($account->getLogin());
     }
     return $return;
 }
开发者ID:alexukua,项目名称:opus4,代码行数:13,代码来源:DocumentAdapter.php

示例5: testGetModel

 public function testGetModel()
 {
     $form = new Admin_Form_Document_Enrichment();
     $document = new Opus_Document(146);
     $enrichments = $document->getEnrichment();
     $enrichment = $enrichments[0];
     $keyNames = $enrichment->getField('KeyName')->getDefault();
     $keyName = $keyNames[1]->getName();
     // Geht davon aus, dass mindestens 2 Enrichment Keys existieren
     $form->getElement('Id')->setValue($enrichment->getId());
     $form->getElement('KeyName')->setValue($keyName);
     $form->getElement('Value')->setValue('Test Enrichment Value');
     $model = $form->getModel();
     $this->assertEquals($enrichment->getId(), $model->getId());
     $this->assertEquals($keyName, $model->getKeyName());
     $this->assertEquals('Test Enrichment Value', $model->getValue());
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:17,代码来源:EnrichmentTest.php

示例6: testRejectDocumentWoPerson

 public function testRejectDocumentWoPerson()
 {
     $helper = new Review_Model_ClearDocumentsHelper();
     $helper->reject(array($this->documentId), 23);
     $document = new Opus_Document($this->documentId);
     $this->assertNotEquals('published', $document->getServerState());
     $this->assertEquals(0, count($document->getPersonReferee()));
     $enrichments = $document->getEnrichment();
     $this->assertEquals(1, count($enrichments));
     $this->assertEquals(23, $enrichments[0]->getValue());
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:11,代码来源:ClearDocumentsHelperTest.php

示例7: ucfirst

    exit;
} else {
    $enrichmentField = $options['enrichment'];
}
$getType = 'getTitle' . ucfirst(strtolower($options['type']));
$addType = 'addTitle' . ucfirst(strtolower($options['type']));
if ($dryrun) {
    _log("TEST RUN: NO DATA WILL BE MODIFIED");
}
$docFinder = new Opus_DocumentFinder();
$docIds = $docFinder->setEnrichmentKeyExists($enrichmentField)->ids();
_log(count($docIds) . " documents found");
foreach ($docIds as $docId) {
    $doc = new Opus_Document($docId);
    if ($doc->getType() == $doctype || $doctype == '') {
        $enrichments = $doc->getEnrichment();
        foreach ($enrichments as $enrichment) {
            $enrichmentArray = $enrichment->toArray();
            if ($enrichmentArray['KeyName'] == $enrichmentField) {
                $titles = $doc->{$getType}();
                if (count($titles) > 0) {
                    _log('Title ' . ucfirst(strtolower($options['type'])) . ' already exists for Document #' . $docId . '. Skipping.. ');
                } else {
                    $title = $doc->{$addType}();
                    $title->setValue($enrichmentArray['Value']);
                    if (!$dryrun) {
                        $doc->store();
                    }
                    _log('Document #' . $docId . ' updated');
                }
            }
开发者ID:alexukua,项目名称:opus4,代码行数:31,代码来源:create_title_from_enrichment.php


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