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


PHP Opus_Document::getIdentifierOpus3方法代码示例

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


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

示例1: loadSignatureFiles

 /**
  * Loads an old Opus ID
  *
  * @param Opus_Document $object Opus-Document for that the files should be registered
  * @return void
  */
 public function loadSignatureFiles($id)
 {
     $object = new Opus_Document($id);
     $this->_tmpPath = null;
     $opusId = $object->getIdentifierOpus3()->getValue();
     // Search the ID-directory in signaturefiles tree
     $this->searchDir($this->_path, $opusId);
     foreach ($object->getFile() as $file) {
         $sigfiles = $this->getFiles($this->_tmpPath, $file->getPathName());
         if (count($sigfiles) > 0) {
             $key = 0;
             foreach ($sigfiles as $signatureFile) {
                 $registered = false;
                 $signature = implode("", file($signatureFile));
                 // check if this signature has been registered
                 $hashes = $file->getHashValue();
                 foreach ($hashes as $hash) {
                     if (substr($hash->getType(), 0, 4) === 'gpg-') {
                         $key++;
                         if ($signature === $hash->getValue()) {
                             $registered = true;
                         }
                     }
                 }
                 // if not, add the signature
                 if ($registered === false) {
                     $hash = new Opus_HashValues();
                     $hash->setType('gpg-' . $key);
                     $hash->setValue($signature);
                     $file->addHashValue($hash);
                 }
                 unset($signatureFile);
             }
         }
         unset($file);
     }
     // Store signature(s) directly
     $object->store();
 }
开发者ID:alexukua,项目名称:opus4,代码行数:45,代码来源:Opus3SignatureImport.php

示例2: foreach

    $doc = new Opus_Document($docId);
    $numOfTitles = 0;
    foreach ($doc->getTitleMain() as $title) {
        if ($title->getLanguage() === $doc->getLanguage()) {
            $numOfTitles++;
        }
    }
    $numOfAbstracts = 0;
    foreach ($doc->getTitleAbstract() as $abstract) {
        if ($abstract->getLanguage() === $doc->getLanguage()) {
            $numOfAbstracts++;
        }
    }
    if ($numOfTitles > 1 || $numOfAbstracts > 1) {
        $msg = "document #{$docId} (";
        $opusThreeId = $doc->getIdentifierOpus3();
        if (count($opusThreeId) > 0) {
            $msg .= 'opus3id #' . $opusThreeId[0]->getValue() . ' ';
        }
        $msg .= 'server_state: ' . $doc->getServerState() . ') needs to be updated manually: has';
        if ($numOfTitles > 1) {
            $msg .= " {$numOfTitles} titles";
        }
        if ($numOfAbstracts > 1) {
            $msg .= " {$numOfAbstracts} abstracts";
        }
        echo $msg . "\n";
        $updateRequired++;
    }
}
if ($updateRequired == 0) {
开发者ID:belapp,项目名称:opus4-application,代码行数:31,代码来源:find_docs_with_multiple_titles_or_abstracts.php

示例3: foreach

    $doc = new Opus_Document($docId);
    $numOfTitles = 0;
    foreach ($doc->getTitleMain() as $title) {
        if ($title->getLanguage() === $doc->getLanguage()) {
            $numOfTitles++;
        }
    }
    $numOfAbstracts = 0;
    foreach ($doc->getTitleAbstract() as $abstract) {
        if ($abstract->getLanguage() === $doc->getLanguage()) {
            $numOfAbstracts++;
        }
    }
    if ($numOfTitles > 1 || $numOfAbstracts > 1) {
        $msg = "document #{$docId} (";
        $opus3Id = $doc->getIdentifierOpus3();
        if (count($opus3Id) > 0) {
            $msg .= 'opus3id #' . $opus3Id[0]->getValue() . ' ';
        }
        $msg .= 'server_state: ' . $doc->getServerState() . ') needs to be updated manually: has';
        if ($numOfTitles > 1) {
            $msg .= " {$numOfTitles} titles";
        }
        if ($numOfAbstracts > 1) {
            $msg .= " {$numOfAbstracts} abstracts";
        }
        echo $msg . "\n";
        $updateRequired++;
    }
}
if ($updateRequired == 0) {
开发者ID:alexukua,项目名称:opus4,代码行数:31,代码来源:find_docs_with_multiple_titles_or_abstracts.php


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