當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Feed_Element::title方法代碼示例

本文整理匯總了PHP中Zend_Feed_Element::title方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Feed_Element::title方法的具體用法?PHP Zend_Feed_Element::title怎麽用?PHP Zend_Feed_Element::title使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Feed_Element的用法示例。


在下文中一共展示了Zend_Feed_Element::title方法的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::title方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。