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


PHP Opus_Document::getPublishedYear方法代码示例

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


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

示例1: getPublishedDate

 /**
  * Return published date.
  *
  * TODO or should it be getPublishedYear (?)
  */
 public function getPublishedDate($yearOnly = false)
 {
     try {
         $date = $this->document->getPublishedDate();
         if (empty($date)) {
             $date = $this->document->getPublishedYear();
         }
         if ($yearOnly && !empty($date) && $date instanceof Opus_Date) {
             return htmlspecialchars($date);
         } else {
             return htmlspecialchars($date);
         }
     } catch (Exception $e) {
         return 'unknown';
     }
 }
开发者ID:alexukua,项目名称:opus4,代码行数:21,代码来源:DocumentAdapter.php

示例2: getPublishedDate

 /**
  * Return published date.
  *
  * TODO or should it be getPublishedYear (?)
  */
 public function getPublishedDate($yearOnly = false)
 {
     $datesHelper = Zend_Controller_Action_HelperBroker::getStaticHelper('Dates');
     try {
         $date = $this->document->getPublishedDate();
         if (empty($date)) {
             $date = $this->document->getPublishedYear();
         }
         if (!empty($date) && $date instanceof Opus_Date) {
             if ($yearOnly) {
                 $date = $date->getYear();
             } else {
                 $date = $datesHelper->getDateString($date);
             }
         }
         return htmlspecialchars($date);
     } catch (Exception $e) {
         return 'unknown';
     }
 }
开发者ID:belapp,项目名称:opus4-application,代码行数:25,代码来源:DocumentAdapter.php

示例3: populateFromModel

 /**
  * Befuellt das Formular anhand der Metadaten eines Dokuments.
  * @param Opus_Document $document
  */
 public function populateFromModel($document)
 {
     $datesHelper = $this->getDatesHelper();
     $this->getElement(self::ELEMENT_LANGUAGE)->setValue($document->getLanguage());
     $this->getElement(self::ELEMENT_TYPE)->setValue($document->getType());
     $date = $datesHelper->getDateString($document->getCompletedDate());
     $this->getElement(self::ELEMENT_COMPLETED_DATE)->setValue($date);
     $this->getElement(self::ELEMENT_COMPLETED_YEAR)->setValue($document->getCompletedYear());
     $date = $datesHelper->getDateString($document->getPublishedDate());
     $this->getElement(self::ELEMENT_PUBLISHED_DATE)->setValue($date);
     $this->getElement(self::ELEMENT_PUBLISHED_YEAR)->setValue($document->getPublishedYear());
     $date = $datesHelper->getDateString($document->getEmbargoDate());
     $this->getElement(self::ELEMENT_EMBARGO_DATE)->setValue($date);
 }
开发者ID:alexukua,项目名称:opus4,代码行数:18,代码来源:General.php


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