當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。