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


PHP Zend_Feed_Element::key方法代码示例

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


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

示例1: _mapAttachment

 /**
  * Maps Zotero attachments to Omeka files, et al. 
  * 
  * @param Zend_Feed_Element
  * @param bool Flag indicating that this is a top-level attachment.
  */
 protected function _mapAttachment(Zend_Feed_Element $element, $topLevelAttachment = false)
 {
     if (!$topLevelAttachment) {
         $this->_elementTexts['Zotero']['Attachment Title'][] = array('text' => $element->title(), 'html' => false);
         $urlXpath = '//default:tr[@class="url"]/default:td';
         if ($url = $this->_contentXpath($element->content, $urlXpath, true)) {
             $this->_elementTexts['Zotero']['Attachment URL'][] = array('text' => $url, 'html' => false);
             // If a attachment that is not top-level has no URL, still assign it
             // a placeholder to maintain relationships between the "Attachment
             // Title" and "Attachment Url" elements.
         } else {
             $this->_elementTexts['Zotero']['Attachment URL'][] = array('text' => '[No URL]', 'html' => false);
         }
     }
     // The Zotero API will not return a file unless a private key exists, so
     // prevent unnecessary requests.
     if (!$this->_privateKey) {
         return;
     }
     // Get the file URLs.
     $method = "{$this->_libraryType}ItemFile";
     $urls = $this->_client->{$method}($this->_libraryId, $element->key());
     // Not all attachments have corresponding files in Amazon S3, so return
     // those that do not.
     if (!$urls['s3']) {
         return;
     }
     // Name the file.
     $uri = Zend_Uri::factory($urls['s3']);
     // Set the original filename as the basename of the URL path.
     $name = urldecode(basename($uri->getPath()));
     // Set the file metadata.
     $this->_fileMetadata['files'][] = array('source' => $urls['zotero'], 'name' => $name, 'metadata' => array('Dublin Core' => array('Title' => array(array('text' => $element->title(), 'html' => false)), 'Identifier' => array(array('text' => $url, 'html' => false)))));
 }
开发者ID:rshiggin,项目名称:omeka-custom-exhibit,代码行数:40,代码来源:ImportProcess.php


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