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